public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
@ 2014-12-08 13:21 ` rguenth at gcc dot gnu.org
  2014-12-08 14:36 ` harald at gigawatt dot nl
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-08 13:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-12-08
          Component|pending                     |c
            Version|unknown                     |4.8.3
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's only reported once for me.


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

* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
  2014-12-08 13:21 ` [Bug c/64223] same warning repeated twice with same line number rguenth at gcc dot gnu.org
@ 2014-12-08 14:36 ` harald at gigawatt dot nl
  2014-12-08 18:33 ` harald at gigawatt dot nl
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: harald at gigawatt dot nl @ 2014-12-08 14:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
I can reproduce the problem with Cygwin headers, and a reduced standalone
program (no standard library headers) is:

int printf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)));

int main(void)
{
    printf("%d\n", 0L);
    return 0;
}

One of the warnings is because of the attribute, the other is built-in to GCC:
removing the format attribute gets rid of a warning, passing
-fno-builtin-printf also gets rid of a warning (presumably the other one).

I do not know if the problem is in the headers (that they should not be
specifying the format attribute), or in GCC (that it should be ignoring the
format attribute if it's already known).


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

* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
  2014-12-08 13:21 ` [Bug c/64223] same warning repeated twice with same line number rguenth at gcc dot gnu.org
  2014-12-08 14:36 ` harald at gigawatt dot nl
@ 2014-12-08 18:33 ` harald at gigawatt dot nl
  2015-03-17  6:47 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: harald at gigawatt dot nl @ 2014-12-08 18:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

--- Comment #4 from Harald van Dijk <harald at gigawatt dot nl> ---
Ah, GCC does not treat format(printf) and format(__printf__) as equivalent, and
the built-in declaration uses format(printf). With custom functions, two
warnings can also be generated:

int myprintf (const char *, ...) __attribute__ ((__format__ (printf, 1, 2)));
int myprintf (const char *, ...) __attribute__ ((__format__ (__printf__, 1,
2)));

int main(void)
{
    myprintf("%d\n", 0L);
    return 0;
}

When combined with gnu_printf and __gnu_printf__, it can become even worse.


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

* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-12-08 18:33 ` harald at gigawatt dot nl
@ 2015-03-17  6:47 ` mpolacek at gcc dot gnu.org
  2015-05-19 12:39 ` mpolacek at gcc dot gnu.org
  2015-06-03  8:25 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-17  6:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |mpolacek at gcc dot gnu.org


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

* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-03-17  6:47 ` mpolacek at gcc dot gnu.org
@ 2015-05-19 12:39 ` mpolacek at gcc dot gnu.org
  2015-06-03  8:25 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-05-19 12:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |6.0

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Testing a patch.


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

* [Bug c/64223] same warning repeated twice with same line number
       [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-05-19 12:39 ` mpolacek at gcc dot gnu.org
@ 2015-06-03  8:25 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-06-03  8:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64223

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Jun  3 08:24:50 2015
New Revision: 224062

URL: https://gcc.gnu.org/viewcvs?rev=224062&root=gcc&view=rev
Log:
        PR c/64223
        PR c/29358
        * tree.c (attribute_value_equal): Handle attribute format.
        (cmp_attrib_identifiers): Factor out of lookup_ident_attribute.

        * gcc.dg/pr64223-1.c: New test.
        * gcc.dg/pr64223-2.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr64223-1.c
    trunk/gcc/testsuite/gcc.dg/pr64223-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c


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

end of thread, other threads:[~2015-06-03  8:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-64223-4@http.gcc.gnu.org/bugzilla/>
2014-12-08 13:21 ` [Bug c/64223] same warning repeated twice with same line number rguenth at gcc dot gnu.org
2014-12-08 14:36 ` harald at gigawatt dot nl
2014-12-08 18:33 ` harald at gigawatt dot nl
2015-03-17  6:47 ` mpolacek at gcc dot gnu.org
2015-05-19 12:39 ` mpolacek at gcc dot gnu.org
2015-06-03  8:25 ` mpolacek 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).