public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/47781] warnings from custom printf format specifiers
Date: Wed, 04 Feb 2015 18:44:00 -0000	[thread overview]
Message-ID: <bug-47781-4-MB86rMGyj1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47781-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #13)
> I have been reconsidering the plugin approach given some new things
> I learned about the details of the firefox code (namely that it doesn't
> faithfully follow printf semantics, sigh).
> 
> One additional note for this bug is that it would be nice if any
> such addition by a plugin worked properly with -Wmissing-format-attribute.

Note that plugins can define attributes. Perhaps one way to go about this would
be to create a plugin that parsed some kind of GCC_printf_format_info attribute
that matches GCC internal printf checking. Then move GCC own format checking to
use this attribute and enable the plugin by default when building GCC.

This will give you as much flexibility as GCC format checking supports, and the
plugin will be developed, build, tested and distributed alongside GCC. Users
outside GCC just need to use the plugin and add the attributes to their own
printf-style functions. Moreover, since the plugin is developed alongside GCC,
it would be logical to add whatever hooks the plugin needs.

Moreover, nothing stops users from creating some kind of intermediate language
that simplifies custom printf attribute syntax. Probably some C preprocessor
magic could be enough.

The challenge is the define the syntax of the attribute, but I think this
challenge is unavoidable for whoever wants to implement this. You may present a
simplified syntax to the user, but you still need to handle correctly all the
complexity and corner cases in c-format.c.
>From gcc-bugs-return-476017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 04 18:45:31 2015
Return-Path: <gcc-bugs-return-476017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9157 invoked by alias); 4 Feb 2015 18:45:30 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 9092 invoked by uid 48); 4 Feb 2015 18:45:27 -0000
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/64921] [4.9/5 Regression] FAIL: gfortran.dg/class_allocate_18.f90
Date: Wed, 04 Feb 2015 18:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pault at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-64921-4-INab0mJH2T@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64921-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64921-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-02/txt/msg00350.txt.bz2
Content-length: 1491

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd921

--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #7)
> (In reply to Paul Thomas from comment #6)
> > (In reply to H.J. Lu from comment #2)
> > > I got
> > >
> > > Program received signal SIGSEGV: Segmentation fault - invalid memory
> > > reference.
> > >
> > > Backtrace for this error:
> > > #0  0xF763FACE
> > > #1  0xF763EBDE
> > > #2  0xF773CBBF
> > > #3  0x8048BA5 in __final_main_T2.3337 at class_allocate_18.f90:?
> > > #4  0x8048D68 in __final_main_T3.3328 at class_allocate_18.f90:?
> > > #5  0x8048A59 in MAIN__ at class_allocate_18.f90:?
> > > FAIL: gfortran.dg/class_allocate_18.f90   -O1  execution test
> > >
> > > But I couldn't reproduce it on another machine. I will keep an eye on it.
> >
> > Hi HJ,
> >
> > Given that the error is sporadic, are you sure that the offending revisions
> > are not 220125 and 220130 - PR64230. The error messages that you are getting
> > are remarkably similar to the original report for this PR.
> >
>
> I don't know for sure.  This failure seems more consistent on 4.9 branch
> than on trunk.

Dear HJ,

I can confirm that the part of resolve.c modified in r220191 is not visited by
the compilation of class_allocate_18.f90.

If I have understood correctly, -fPIC is not supported on x86_64 and so, unless
I am mistaken, I cannot help you further.

Please let me know if there is anything that I can do to help.

Best regards

Paul


  parent reply	other threads:[~2015-02-04 18:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 11:55 [Bug c/47781] New: " mark-gcc at glines dot org
2011-02-17 11:58 ` [Bug c/47781] " manu at gcc dot gnu.org
2011-02-17 12:00 ` mark-gcc at glines dot org
2011-02-17 12:14 ` mark-gcc at glines dot org
2011-02-17 18:38 ` joseph at codesourcery dot com
2013-09-23 21:54 ` pinskia at gcc dot gnu.org
2013-09-23 21:55 ` pinskia at gcc dot gnu.org
2013-09-23 21:57 ` pinskia at gcc dot gnu.org
2014-08-21 17:07 ` joseph at codesourcery dot com
2014-08-21 17:54 ` philipp_subx@redfish-solutions.com
2015-01-29 16:42 ` tromey at gcc dot gnu.org
2015-01-29 21:55 ` joseph at codesourcery dot com
2015-02-04 17:38 ` tromey at gcc dot gnu.org
2015-02-04 18:44 ` manu at gcc dot gnu.org [this message]
2015-09-21 19:16 ` egall at gwmail dot gwu.edu
2020-12-13 15:48 ` dcrocker at eschertech dot com
2020-12-14 14:10 ` tromey at gcc dot gnu.org
2021-12-06 17:47 ` grant.b.edwards at gmail dot com
2021-12-06 22:48 ` joseph at codesourcery dot com
2023-01-18 11:03 ` jan@swi-prolog.org
2023-01-18 12:11 ` manu at gcc dot gnu.org
2023-01-18 17:40 ` joseph at codesourcery dot com
2023-01-18 17:46 ` manu at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47781-4-MB86rMGyj1@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).