Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible Pointer Type Errors with GNU Compiler 14.1.0 #536

Open
Ho3eintaji opened this issue Jun 26, 2024 · 2 comments
Open

Incompatible Pointer Type Errors with GNU Compiler 14.1.0 #536

Ho3eintaji opened this issue Jun 26, 2024 · 2 comments

Comments

@Ho3eintaji
Copy link
Contributor

There is a bunch of casting issues in the software.
When compiling with GNU 11.1.0, which is used for x-heep, it does not run into errors, but when compiling with a higher version, like GNU 14.1.0, which is used for heepatia, the applications are not compiling.
Example: example_gpio_intr

@JoseCalero
Copy link
Collaborator

JoseCalero commented Jun 26, 2024

  1. please, write better issue names as having an issue called "causing issues" is a bit ... useless
  2. heepatia or any other xheep derivative is supposed to be adapting to what xheep is having and/or extending that, i.e if extending requires new versions of whatever tool we use, of course these problems are gonna rise
  3. the thing you are describing is an issue in heepatia, not in here
  4. give a proper reason to upgrade the gnu version

@Ho3eintaji Ho3eintaji changed the title Casting issues Incompatible Pointer Type Errors with GNU Compiler 14.1.0 Jun 27, 2024
@Ho3eintaji
Copy link
Contributor Author

Hey Jose,

  • It was "casting" not "causing". However, I have changed it to a more proper name.

  • We have encountered several compile-time errors related to incompatible pointer types when compiling with GNU Compiler version 14.1.0. These issues were not present with GNU Compiler version 11.1.0, simply because it is less strict with type checking. However, the issues still exist.

  • I think it would be beneficial to address these issues to ensure compatibility for x-heep based platforms that are using newer versions of GCC.

  • Below are some examples of these errors:

  1. File: sw/applications/example_gpio_intr/main.c

    • Line: 141
    • Error:
      passing argument 2 of 'gpio_assign_irq_handler' from incompatible pointer type [-Wincompatible-pointer-types]
      gpio_assign_irq_handler( GPIO_INTR, &handler_1 );
                                           ^~~~~~~~~~
                                           void (*)()
      
    • Expected Type: void * (*)()
    • Actual Type: void (*)()
  2. File: sw/device/lib/sdk/dma/dma_sdk.c

    • Line: 70
    • Error:
      initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint32_t *' {aka 'long unsigned int *'} [-Wincompatible-pointer-types]
      .ptr = dst,
              ^~~
      

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

No branches or pull requests

2 participants