This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Silence gcc-8 warnings


On 04/24/2018 06:07 AM, Michael Matz wrote:
Hi,

On Tue, 24 Apr 2018, Alan Modra wrote:

The elf-linux-core.h header is regarded as system header with the #line
directives, and that disables the warning.

Horrible.

I'm not claiming otherwise :-)

#include <string.h>
#define strncpy(dest, src, n) __builtin_strncpy (dest, src, n)

Remove the #define and there's no warning!

Probably not the intent of the warning, which should depend on the place
of the original call not on the place of some intermediate defines.

Right.  There is a way to make it work that way but it's easy to
forget.  I just submitted a patch for a different GCC problem
(bug 85259) that also enables the truncation warning irrespective
of system header macros.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]