Closed ra1nb0w closed 2 days ago
I read the post ,does it work with (int)(1U << 31U)
?
works fine. Also tested with
/**
* build with
* gcc -Wfatal-errors -Wall -Wextra -Wpedantic -std=c11
*/
#include <stdio.h>
#include <stdint.h>
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
#define BYTE_TO_BINARY(byte) \
((byte) & 0x80 ? '1' : '0'), \
((byte) & 0x40 ? '1' : '0'), \
((byte) & 0x20 ? '1' : '0'), \
((byte) & 0x10 ? '1' : '0'), \
((byte) & 0x08 ? '1' : '0'), \
((byte) & 0x04 ? '1' : '0'), \
((byte) & 0x02 ? '1' : '0'), \
((byte) & 0x01 ? '1' : '0')
typedef enum
{
A = (int)(1U << 31U),
} size_test;
int main(void)
{
printf(BYTE_TO_BINARY_PATTERN " " BYTE_TO_BINARY_PATTERN " " BYTE_TO_BINARY_PATTERN " " BYTE_TO_BINARY_PATTERN "\n",
BYTE_TO_BINARY(A >> 24), BYTE_TO_BINARY(A >> 16), BYTE_TO_BINARY(A >> 8), BYTE_TO_BINARY(A)
);
}
Do you need a PR or do the change yourself? Anyway, thank you very much for all your work!
Please make a PR so I can approve it sooner.
Operating System
Linux
Board
STM32H563 Nucleo
Firmware
custom
What happened ?
These lines issue a warning/error when strictly following the ISO C standard before 23 https://github.com/hathach/tinyusb/blob/756ad3553d095b69cf3276e3967381eba958232e/src/class/audio/audio.h#L492 https://github.com/hathach/tinyusb/blob/756ad3553d095b69cf3276e3967381eba958232e/src/class/audio/audio.h#L643
How to reproduce ?
built with
gcc -Wfatal-errors -Wall -Wextra -Wpedantic -std=c11
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Screenshots
No response
I have checked existing issues, dicussion and documentation