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

LOL #8

Open
Zibri opened this issue Jan 24, 2023 · 0 comments
Open

LOL #8

Zibri opened this issue Jan 24, 2023 · 0 comments

Comments

@Zibri
Copy link

Zibri commented Jan 24, 2023

$ make
g++ -Isrc/ src/crc32.cpp -o bin/crc32
g++ -Isrc/ src/enum_crc32.cpp -o bin/enum
src/enum_crc32.cpp: In function ‘int main()’:
src/enum_crc32.cpp:28:35: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
   28 |     printf( "String: '%s' (Input:%d)\n", text, length );
      |                                  ~^            ~~~~~~
      |                                   |            |
      |                                   int          size_t {aka long unsigned int}
      |                                  %ld
g++ -Isrc/ src/tables_crc32.cpp -o bin/tables
g++ -Isrc/ src/trace_crc32.cpp -o bin/trace
src/trace_crc32.cpp: In function ‘uint32_t crc32_trace_normal(const uint32_t*, size_t, const void*)’:
src/trace_crc32.cpp:27:18: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Wformat=]
   27 | printf( "^buf[%04X]: %02X -> %02X bits reversed\n", (buffer - (const unsigned char*)data) & 0xFFFF, *buffer, reverse[ *buffer ] );
      |               ~~~^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |                                                                        |
      |                  unsigned int                                                             long int
      |               %04lX
src/trace_crc32.cpp: In function ‘uint32_t crc32_trace_normal_broken(const uint32_t*, size_t, const void*)’:
src/trace_crc32.cpp:52:18: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Wformat=]
   52 | printf( "^buf[%04X]: %02X                      \n", (buffer - (const unsigned char*)data) & 0xFFFF, *buffer );
      |               ~~~^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |                                                                        |
      |                  unsigned int                                                             long int
      |               %04lX
src/trace_crc32.cpp: In function ‘uint32_t crc32_reflect_trace(const uint32_t*, size_t, const void*)’:
src/trace_crc32.cpp:75:18: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Wformat=]
   75 | printf( "^buf[%04X]: %02X\n", (buffer - (const unsigned char*)data) & 0xFFFF, *buffer );
      |               ~~~^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |                                                  |
      |                  unsigned int                                       long int
      |               %04lX
src/trace_crc32.cpp: In function ‘int main()’:
src/trace_crc32.cpp:143:5: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ [-Wnarrowing]
  143 |     };
      |     ^
src/trace_crc32.cpp:143:5: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ [-Wnarrowing]
src/trace_crc32.cpp:143:5: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ [-Wnarrowing]
src/trace_crc32.cpp:143:5: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ [-Wnarrowing]
make: *** [Makefile:84: bin/trace] Error 1
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

1 participant