Skip to content

cdo: Fix incompatible-pointer-types in cdoseq_load_cdo_from_buffer#47

Open
bradfa wants to merge 1 commit into
Xilinx:masterfrom
bradfa:master-fix-compile-error
Open

cdo: Fix incompatible-pointer-types in cdoseq_load_cdo_from_buffer#47
bradfa wants to merge 1 commit into
Xilinx:masterfrom
bradfa:master-fix-compile-error

Conversation

@bradfa

@bradfa bradfa commented Jun 22, 2026

Copy link
Copy Markdown

GCC 14 promotes -Wincompatible-pointer-types to a hard error, so the build fails with:

  utils/src/cdo-load.c:140:14: error: assignment to 'char *' from incompatible pointer type 'uint32_t *' {aka 'unsigned int *'} [-Wincompatible-pointer-types]
    140 |         data = raw->data;
        |              ^
  make: *** [Makefile:81: build/obj/cdo-load.o] Error 1

The function parameter data is char *, but raw->data (struct CdoRawInfo) is uint32_t *. The sibling function cdoseq_load_cdo avoids this because its local data is void *, which accepts any pointer without a cast.

Add an explicit (char *) cast.

GCC 14 promotes -Wincompatible-pointer-types to a hard error, so the
build fails with:

  utils/src/cdo-load.c:140:14: error: assignment to 'char *' from incompatible pointer type 'uint32_t *' {aka 'unsigned int *'} [-Wincompatible-pointer-types]
    140 |         data = raw->data;
        |              ^
  make: *** [Makefile:81: build/obj/cdo-load.o] Error 1

The function parameter data is char *, but raw->data (struct CdoRawInfo)
is uint32_t *. The sibling function cdoseq_load_cdo avoids this because
its local data is void *, which accepts any pointer without a cast.

Add an explicit (char *) cast.

Signed-off-by: Andrew Bradford <andrew.bradford@konsulko.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant