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

Compiler warning when using optimized/release build #970

Closed
jphickey opened this issue Oct 27, 2020 · 0 comments · Fixed by #971 or #991
Closed

Compiler warning when using optimized/release build #970

jphickey opened this issue Oct 27, 2020 · 0 comments · Fixed by #971 or #991
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
A compiler warning pops up when enabling full optimizations:

In function ‘strncpy’,
    inlined from ‘CFE_ES_ReloadApp’ at /home/joe/code/cfecfs/github/cfe/fsw/cfe-core/src/es/cfe_es_api.c:259:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 64 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

To Reproduce
Build with BUILDTYPE=release using a recent GCC (e.g. v9.0+) such as the one with Ubuntu 20.04

Expected behavior
Should build cleanly

System observed on:
Ubuntu 20.04

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Oct 27, 2020
jphickey added a commit to jphickey/cFE that referenced this issue Oct 27, 2020
Adjust strncpy call to not trigger warning
jphickey added a commit to jphickey/cFE that referenced this issue Oct 29, 2020
Adjust strncpy call to not trigger warning
@astrogeco astrogeco added this to the 7.0.0 milestone Nov 2, 2020
astrogeco added a commit that referenced this issue Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants