- **status**: accepted --> review
---
** [tickets:#3134] build: fix compile issues with gcc 9.x**
**Status:** review
**Milestone:** 5.20.01
**Created:** Thu Dec 19, 2019 04:53 PM UTC by Alex Jones
**Last Updated:** Thu Dec 19, 2019 04:53 PM UTC
**Owner:** Alex Jones
Compiling OpenSAF with gcc 9.2.1 gives errors. Most of these errors are due to
uses of strncpy, strncat, etc. The compiler is complaining about possible
string operation overflows. Here is an example:
In file included from /usr/include/string.h:494,
from src/imm/tools/imm_import.cc:26:
In function 'char* strncpy(char*, const char*, size_t)',
inlined from 'void charactersHandler(void*, const xmlChar*, int)' at
src/imm/tools/imm_import.cc:1856:18:
/usr/include/bits/string_fortified.h:106:34: error: 'char*
__builtin_strncpy(char*, const char*, long unsigned int)' specified bound
depends on the length of the source argument [-Werror=stringop-overflow=]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/imm/tools/imm_import.cc: In function 'void charactersHandler(void*, const
xmlChar*, int)':
src/imm/tools/imm_import.cc:1846:34: note: length computed here
1846 | size_t oldsize = strlen(state->attrValueBuffers.front());
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets