8000 2.8.6: gcc 9 warnings · Issue #385 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

2.8.6: gcc 9 warnings #385

Closed
Closed

Description

@kloczek

It would be good to clean all those warnings :)

/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c: In function 'aes_encrypt':
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:117:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  117 |         kp += 2 * N_COLS;
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:118:5: note: here
  118 |     case 12 * 16:
      |     ^~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:121:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
  121 |         kp += 2 * N_COLS;
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:122:5: note: here
  122 |     case 10 * 16:
      |     ^~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c: In function 'aes_decrypt':
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:198:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  198 | #define inv_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
      |                             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:49:64: note: in expansion of macro 'inv_rnd'
   49 | #define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
      |                                                                ^~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:249:9: note: in expansion of macro 'round'
  249 |         round(inv_rnd,  b0, b1, rnd_key(-12));
      |         ^~~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:250:5: note: here
  250 |     case 12 * 16:
      |     ^~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:198:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  198 | #define inv_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
      |                             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:49:64: note: in expansion of macro 'inv_rnd'
   49 | #define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
      |                                                                ^~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:252:9: note: in expansion of macro 'round'
  252 |         round(inv_rnd,  b0, b1, rnd_key(-10));
      |         ^~~~~
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/lib/brg/aescrypt.c:253:5: note: here
  253 |     case 10 * 16:
      |     ^~~~
In function 'strncpy',
    inlined from 'mz_os_get_file_date' at /home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/mz_os_posix.c:174:9:
/usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/mz_os_posix.c: In function 'mz_os_get_file_date':
/home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/mz_os_posix.c:172:15: note: length computed here
  172 |         len = strlen(path);
      |               ^
In file included from /usr/include/string.h:494,
                 from /home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/mz.h:156,
                 from /home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/test/test.c:12:
In function 'strncpy',
    inlined from 'test_crypt_aes' at /home/tkloczko/rpmbuild/BUILD/minizip-2.8.6/test/test.c:609:5:
/usr/include/bits/string_fortified.h:106:10: warning: 'strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activity

  1. nmoinvaz commented on Apr 30, 2019

    @nmoinvaz
    Member

    I do accept pull requests. :-) The brg library is not really something I maintain thou.

  2. Coeur commented on May 1, 2019

    @Coeur
    Collaborator

    @kloczek if you replace strncpy with strlcpy, does it fix a warning for you?

    Also, I'm not sure that we care about -Wimplicit-fallthrough (as it's inconvenient to make it explicit), so you may ignore it.

  3. nmoinvaz commented on May 1, 2019

    @nmoinvaz
    Member

    Or could use memcpy there too which is available on all platforms.

  4. kloczek commented on May 1, 2019

    @kloczek
    ContributorAuthor

    I do accept pull requests. :-) The brg library is not really something I maintain thou.

    Don't get me wrong but my main task is to cleanly packaged some stuff.
    Just dropped you warnings which popped on front of me when I've been building minizip :)

  5. added a commit that references this issue on May 1, 2019
  6. nmoinvaz commented on May 1, 2019

    @nmoinvaz
    Member

    Ok I think I have fixed some. But I don't have GCC 9 so I can't really test. And the BRG warnings I don't plan on fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilationIssues related to compiling source code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0