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

Does not compile with gcc (starting from Fedora 32) #201

Closed
elpito opened this issue May 23, 2020 · 2 comments · Fixed by #202
Closed

Does not compile with gcc (starting from Fedora 32) #201

elpito opened this issue May 23, 2020 · 2 comments · Fixed by #202

Comments

@elpito
Copy link

elpito commented May 23, 2020

Fedora 32 ships with gcc version 10, but, the source does not compile anymore (ld). On Fedora 31 (gcc 9), it worked. Here the compiler failure message:

src/request_queue.c: In function 'request_queue_remove_request':
src/request_queue.c:323:9: warning: enumeration value 'queueRender' not handled in switch [-Wswitch]
  323 |         switch (request->originatedQueue) {
      |         ^~~~~~
src/request_queue.c:323:9: warning: enumeration value 'queueDuplicate' not handled in switch [-Wswitch]
src/request_queue.c: In function 'request_queue_no_requests_queued':
src/request_queue.c:342:5: warning: enumeration value 'cmdIgnore' not handled in switch [-Wswitch]
  342 |     switch(priority) {
      |     ^~~~~~
src/request_queue.c:342:5: warning: enumeration value 'cmdDone' not handled in switch [-Wswitch]
src/request_queue.c:342:5: warning: enumeration value 'cmdNotDone' not handled in switch [-Wswitch]
src/protocol_helper.c: In function 'recv_cmd':
src/protocol_helper.c:64:9: warning: 'ret2' may be used uninitialized in this function [-Wmaybe-uninitialized]
   64 |     ret += ret2;
      |     ~~~~^~~~~~~
src/store_file.c: In function 'file_tile_storage_id':
src/store_file.c:173:44: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4088 [-Wformat-truncation=]
  173 |     snprintf(string, PATH_MAX - 1, "file://%s", meta_path);
      |                                            ^~   ~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 8 and 4103 bytes into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c: In function 'file_tile_read':
src/store_file.c:81:51: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4085 [-Wformat-truncation=]
   81 |         snprintf(log_msg,PATH_MAX - 1, "Meta file %s too small to contain header\n", path);
      |                                                   ^~                                 ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 40 and 4135 bytes into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:88:55: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4085 [-Wformat-truncation=]
   88 |             snprintf(log_msg,PATH_MAX - 1, "Meta file %s header magic mismatch\n", path);
      |                                                       ^~                           ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 34 and 4129 bytes into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:128:76: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4065 [-Wformat-truncation=]
  128 |             snprintf(log_msg, PATH_MAX - 1, "Failed to read data from file %s. Reason: %s\n", path, strerror(errno));
      |                                                                            ^~                 ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 42 or more bytes (assuming 4137) into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:118:52: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4085 [-Wformat-truncation=]
  118 |         snprintf(log_msg, PATH_MAX - 1, "Meta file %s seek error: %s\n", path, strerror(errno));
      |                                                    ^~                    ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 25 or more bytes (assuming 4120) into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:99:52: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4085 [-Wformat-truncation=]
   99 |         snprintf(log_msg, PATH_MAX - 1, "Meta file %s header bad count %d != %d\n", path, m->count, METATILE * METATILE);
      |                                                    ^~                               ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 37 and 4142 bytes into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:70:89: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4051 [-Wformat-truncation=]
   70 |             snprintf(log_msg,PATH_MAX - 1, "Failed to read complete header for metatile %s Reason: %s\n", path, strerror(errno));
      |                                                                                         ^~                ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 55 or more bytes (assuming 4150) into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/store_file.c:60:65: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4071 [-Wformat-truncation=]
   60 |         snprintf(log_msg,PATH_MAX - 1, "Could not open metatile %s. Reason: %s\n", path, strerror(errno));
      |                                                                 ^~                 ~~~~
In file included from /usr/include/stdio.h:867,
                 from src/store_file.c:9:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 36 or more bytes (assuming 4131) into a destination of size 4095
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: src/renderd-gen_tile.o:/root/rpmbuild/BUILD/mod_tile-0.5/./includes/daemon.h:48: multiple definition of `render_request_queue'; src/daemon.o:/root/rpmbuild/BUILD/mod_tile-0.5/./includes/daemon.h:48: first defined here
collect2: error: ld returned 1 exit status
@elpito
Copy link
Author

elpito commented Jul 24, 2020

Thank you, using the patch, it compiles with gcc 10 environments.

@elpito elpito closed this as completed Jul 24, 2020
@pantierra
Copy link
Collaborator

This might be slightly related to #232.

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 a pull request may close this issue.

2 participants