public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32953]  New: -Wformat warns incorrectly on an unterminated format string of length 1
@ 2007-08-01  3:40 dsh at gcc dot gnu dot org
  2007-08-13 21:55 ` [Bug c/32953] " dsh at gcc dot gnu dot org
  2007-08-13 22:09 ` dsh at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: dsh at gcc dot gnu dot org @ 2007-08-01  3:40 UTC (permalink / raw)
  To: gcc-bugs

[test]$ cat bar.c
#include <stdio.h>
const char s[1] = "s";
int
main (void)
{
  printf (s);
  return 0;
}
[test]$ gcc-svn -v
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../gcc.orig/configure --prefix=/home/dsh --program-suffix=-svn
--build=i686-linux-gnu --enable-languages=all
Thread model: posix
gcc version 4.3.0 20070731 (experimental)
[test]$ gcc-svn -std=gnu99 -Wformat=2 bar.c
bar.c: In function 'main':
bar.c:6: warning: zero-length printf format string

The format string is not zero-length, it's unterminated.  The fix is simple. 
I've got a patch and will send it in shortly.


-- 
           Summary: -Wformat warns incorrectly on an unterminated format
                    string of length 1
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dsh at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32953


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/32953] -Wformat warns incorrectly on an unterminated format string of length 1
  2007-08-01  3:40 [Bug c/32953] New: -Wformat warns incorrectly on an unterminated format string of length 1 dsh at gcc dot gnu dot org
@ 2007-08-13 21:55 ` dsh at gcc dot gnu dot org
  2007-08-13 22:09 ` dsh at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: dsh at gcc dot gnu dot org @ 2007-08-13 21:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dsh at gcc dot gnu dot org  2007-08-13 21:55 -------
Subject: Bug 32953

Author: dsh
Date: Mon Aug 13 21:55:01 2007
New Revision: 127399

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127399
Log:
gcc/
2007-08-3 1 Dan Hipschman  <dsh@google.com>

        PR 32953
        * c-format.c (check_format_arg): Move check for zero-length
        format strings below the check for unterminated strings.

testsuite/
2007-08-13  Dan Hipschman  <dsh@google.com>

        PR 32953
        * gcc.dg/format/array-1.c: Add an additional test for
        unterminated format strings of length 1.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-format.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/format/array-1.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32953


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/32953] -Wformat warns incorrectly on an unterminated format string of length 1
  2007-08-01  3:40 [Bug c/32953] New: -Wformat warns incorrectly on an unterminated format string of length 1 dsh at gcc dot gnu dot org
  2007-08-13 21:55 ` [Bug c/32953] " dsh at gcc dot gnu dot org
@ 2007-08-13 22:09 ` dsh at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: dsh at gcc dot gnu dot org @ 2007-08-13 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dsh at gcc dot gnu dot org  2007-08-13 22:09 -------
Fixed.


-- 

dsh at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32953


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-13 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01  3:40 [Bug c/32953] New: -Wformat warns incorrectly on an unterminated format string of length 1 dsh at gcc dot gnu dot org
2007-08-13 21:55 ` [Bug c/32953] " dsh at gcc dot gnu dot org
2007-08-13 22:09 ` dsh at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).