bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] inttostr.h: add compile-time buffer overrun checks


From: Bruno Haible
Subject: Re: [PATCH] inttostr.h: add compile-time buffer overrun checks
Date: Tue, 19 Oct 2010 00:10:48 +0200
User-agent: KMail/1.9.9

Hi Paolo,

Paolo Bonzini wrote:
> Maybe it is worthwhile however 
> to enable the checks for 4.1 with the sole exception of the link-time 
> warning.  For 4.1 and 4.2, leave out the aliasing of inttostr_chk_warn 
> so that it remains undefined and linking fails.

Giving a link error on perfectly valid code like

  if (halting_problem_solvable ())
    {
      char buf[5];
      return strdup (inttostr (n, buf)); /* expect warning here */
    }

would be considered as a bug if it were done by a compiler. So I would
consider it a bug as well if the link error was caused by gnulib macros.

A link warning would be fine, however, through build-aux/link-warning.h
for example. But this would be additional complexity, just to accommodate
a generation of compilers that is about 3 years old, and thus already being
superseded in many distributions.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]