Skip to content

Conversation

@yamt
Copy link
Owner

@yamt yamt commented Apr 11, 2025

fix GCC warnings for the target with long uint32_t

Note: on some targets, int32_t is a long.
eg. GCC in the recent ESP-IDF has such a configuration.

    spacetanuki% xtensa-esp32-elf-gcc --version
    xtensa-esp32-elf-gcc (crosstool-NG esp-12.2.0_20230208) 12.2.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    spacetanuki% xtensa-esp32-elf-gcc -dM -E - < /dev/null | grep -E "(SIZE|INT32)_TYPE"
    #define __SIZE_TYPE__ unsigned int
    #define __INT32_TYPE__ long int
    #define __UINT32_TYPE__ long unsigned int
    spacetanuki%

references:
apache/nuttx#16022
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes

Note: on some targets, int32_t is a long.
eg. GCC in the recent ESP-IDF has such a configuration.

```shell
    spacetanuki% xtensa-esp32-elf-gcc --version
    xtensa-esp32-elf-gcc (crosstool-NG esp-12.2.0_20230208) 12.2.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    spacetanuki% xtensa-esp32-elf-gcc -dM -E - < /dev/null | grep -E "(SIZE|INT32)_TYPE"
    #define __SIZE_TYPE__ unsigned int
    #define __INT32_TYPE__ long int
    #define __UINT32_TYPE__ long unsigned int
    spacetanuki%
```

references:
apache/nuttx#16022
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/migration-guides/release-5.x/5.0/gcc.html#espressif-toolchain-changes
@yamt yamt merged commit 5006283 into master Apr 12, 2025
289 of 290 checks passed
@yamt yamt deleted the long-uint32 branch April 12, 2025 00:54
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.

2 participants