public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56048] New: -Werror=format=2 does not work
@ 2013-01-19 19:20 hdante at gmail dot com
  2013-01-21 11:27 ` [Bug c/56048] " manu at gcc dot gnu.org
  2013-01-21 12:32 ` manu at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hdante at gmail dot com @ 2013-01-19 19:20 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56048
           Summary: -Werror=format=2 does not work
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hdante@gmail.com


Created attachment 29222
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29222
format-warning.c

format-warning.c:
#include <stdio.h>

int main(void)
{
    const char *s = "%s\n";
    printf(s, "abcd");
    return 0;
}

$ gcc -Wall -Werror -Werror=format=2 -o format-warning format-warning.c (no
error)

$ gcc -Wall -Werror -Werror=format -Werror=format-nonliteral
-Werror=format-security -Werror=format-y2k -o format-warning format-warning.c 
format-warning.c: Na função ‘main’:
format-warning.c:6:2: error: format not a string literal, argument types not
checked [-Werror=format-nonliteral]


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

* [Bug c/56048] -Werror=format=2 does not work
  2013-01-19 19:20 [Bug c/56048] New: -Werror=format=2 does not work hdante at gmail dot com
@ 2013-01-21 11:27 ` manu at gcc dot gnu.org
  2013-01-21 12:32 ` manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2013-01-21 11:27 UTC (permalink / raw)
  To: gcc-bugs


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-01-21 11:26:52 UTC ---
I think this may be fixed in GCC 4.8, but I don't have a recently build GCC at
hand to test it.


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

* [Bug c/56048] -Werror=format=2 does not work
  2013-01-19 19:20 [Bug c/56048] New: -Werror=format=2 does not work hdante at gmail dot com
  2013-01-21 11:27 ` [Bug c/56048] " manu at gcc dot gnu.org
@ 2013-01-21 12:32 ` manu at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2013-01-21 12:32 UTC (permalink / raw)
  To: gcc-bugs


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-01-21
     Ever Confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-01-21 12:31:54 UTC ---
(In reply to comment #1)
> I think this may be fixed in GCC 4.8, but I don't have a recently build GCC at
> hand to test it.

Actually, it is not. opts.c:control_warning_as_error doesn't handle options
with joined arguments, the argument is ignored. Extra code would need to be
added to check that the option is joined, that it has an argument, read the
argument and pass the correct value to control_warning. Then, it should work.


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

end of thread, other threads:[~2013-01-21 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-19 19:20 [Bug c/56048] New: -Werror=format=2 does not work hdante at gmail dot com
2013-01-21 11:27 ` [Bug c/56048] " manu at gcc dot gnu.org
2013-01-21 12:32 ` manu at gcc dot gnu.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).