public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
@ 2014-10-17 17:08 Manuel López-Ibáñez
  2014-10-17 17:34 ` Joseph S. Myers
  0 siblings, 1 reply; 7+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-17 17:08 UTC (permalink / raw)
  To: Gcc Patch List, Joseph S. Myers, Marek Polacek, Paolo Carlini,
	Jason Merrill, Dodji Seketeli, Jonathan Wakely

> The Right Thing is for -pedantic not to cause errors, only warnings
> (-pedantic-errors being needed for an error).  So rather than having this
> conditional for whether to allow the extension at all, make the
> conditional code do a pedwarn (if flag_isoc99, otherwise there will
> already have been one for using a compound literal at all, and not for
> VECTOR_TYPE).  (I don't believe this can affect the semantics of valid
> code; in this case of require_constant with a compound literal, we know
> the code is invalid in ISO C terms, so it's safe to diagnose it then
> interpret it in a sensible way.)

I think there is roughly consensus about how C/C++ diagnostics should
work, but it is easy to forget it since it is not really written
anywhere.

Thus, I drafted some guidelines
at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines

Please, could you take a look and comment whether I got it right/wrong?
New items are very welcome!

Cheers,

Manuel.

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

* Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
  2014-10-17 17:08 C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)) Manuel López-Ibáñez
@ 2014-10-17 17:34 ` Joseph S. Myers
  2014-10-17 18:07   ` Manuel López-Ibáñez
  0 siblings, 1 reply; 7+ messages in thread
From: Joseph S. Myers @ 2014-10-17 17:34 UTC (permalink / raw)
  To: Manuel López-Ibáñez
  Cc: Gcc Patch List, Marek Polacek, Paolo Carlini, Jason Merrill,
	Dodji Seketeli, Jonathan Wakely

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:

> Thus, I drafted some guidelines
> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines
> 
> Please, could you take a look and comment whether I got it right/wrong?

Yes, that looks right to me.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
  2014-10-17 17:34 ` Joseph S. Myers
@ 2014-10-17 18:07   ` Manuel López-Ibáñez
  2014-10-17 19:26     ` Manuel López-Ibáñez
  2014-10-23 10:40     ` Dodji Seketeli
  0 siblings, 2 replies; 7+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-17 18:07 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: Gcc Patch List, Marek Polacek, Paolo Carlini, Jason Merrill,
	Dodji Seketeli, Jonathan Wakely

On 17 October 2014 19:33, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:
>
>> Thus, I drafted some guidelines
>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines
>>
>> Please, could you take a look and comment whether I got it right/wrong?
>
> Yes, that looks right to me.

Thanks!

I added guidelines also about locations and warning options.

Cheers,

Manuel.

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

* Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))
  2014-10-17 18:07   ` Manuel López-Ibáñez
@ 2014-10-17 19:26     ` Manuel López-Ibáñez
  2014-10-23 10:58       ` C/C++ diagnostics guidelines Dodji Seketeli
  2014-10-23 10:40     ` Dodji Seketeli
  1 sibling, 1 reply; 7+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-17 19:26 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: Gcc Patch List, Marek Polacek, Paolo Carlini, Jason Merrill,
	Dodji Seketeli, Jonathan Wakely

On 17 October 2014 20:04, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> On 17 October 2014 19:33, Joseph S. Myers <joseph@codesourcery.com> wrote:
>> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:
>>
>>> Thus, I drafted some guidelines
>>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines
>>>
>>> Please, could you take a look and comment whether I got it right/wrong?
>>
>> Yes, that looks right to me.
>
> Thanks!
>
> I added guidelines also about locations and warning options.

I believe there are also some rules about when to use some special
line-map functions that arise when warning about macros like NULL, but
I am not aware of the specifics. It would be useful if someone added
those.

Dodji, Paolo? Do you know what I'm talking about?

Cheers,

Manuel.

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

* Re: C/C++ diagnostics guidelines
  2014-10-17 18:07   ` Manuel López-Ibáñez
  2014-10-17 19:26     ` Manuel López-Ibáñez
@ 2014-10-23 10:40     ` Dodji Seketeli
  2014-11-01 23:43       ` Manuel López-Ibáñez
  1 sibling, 1 reply; 7+ messages in thread
From: Dodji Seketeli @ 2014-10-23 10:40 UTC (permalink / raw)
  To: Manuel López-Ibáñez
  Cc: Joseph S. Myers, Gcc Patch List, Marek Polacek, Paolo Carlini,
	Jason Merrill, Jonathan Wakely

Manuel López-Ibáñez <lopezibanez@gmail.com> writes:

> On 17 October 2014 19:33, Joseph S. Myers <joseph@codesourcery.com> wrote:
>> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:
>>
>>> Thus, I drafted some guidelines
>>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines
>>>
>>> Please, could you take a look and comment whether I got it right/wrong?
>>
>> Yes, that looks right to me.
>
> Thanks!
>
> I added guidelines also about locations and warning options.

I like these very much.  Thank you for looking into this.

To take this further, I am thinking that these guidelines would be even
better served by standing on their own page.  If nobody objects, I can
create a  DiagnosticsGuidelines page in the wiki with the content that you added.

Cheers,

-- 
		Dodji

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

* Re: C/C++ diagnostics guidelines
  2014-10-17 19:26     ` Manuel López-Ibáñez
@ 2014-10-23 10:58       ` Dodji Seketeli
  0 siblings, 0 replies; 7+ messages in thread
From: Dodji Seketeli @ 2014-10-23 10:58 UTC (permalink / raw)
  To: Manuel López-Ibáñez
  Cc: Joseph S. Myers, Gcc Patch List, Marek Polacek, Paolo Carlini,
	Jason Merrill, Jonathan Wakely

Manuel López-Ibáñez <lopezibanez@gmail.com> writes:

> On 17 October 2014 20:04, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
>> On 17 October 2014 19:33, Joseph S. Myers <joseph@codesourcery.com> wrote:
>>> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:
>>>
>>>> Thus, I drafted some guidelines
>>>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines
>>>>
>>>> Please, could you take a look and comment whether I got it right/wrong?
>>>
>>> Yes, that looks right to me.
>>
>> Thanks!
>>
>> I added guidelines also about locations and warning options.
>
> I believe there are also some rules about when to use some special
> line-map functions that arise when warning about macros like NULL, but
> I am not aware of the specifics. It would be useful if someone added
> those.
>
> Dodji, Paolo? Do you know what I'm talking about?

Hmmh, I am not sure.  Do you have any example of warning about such
macros?

Cheers,

-- 
		Dodji

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

* Re: C/C++ diagnostics guidelines
  2014-10-23 10:40     ` Dodji Seketeli
@ 2014-11-01 23:43       ` Manuel López-Ibáñez
  0 siblings, 0 replies; 7+ messages in thread
From: Manuel López-Ibáñez @ 2014-11-01 23:43 UTC (permalink / raw)
  To: Dodji Seketeli
  Cc: Joseph S. Myers, Gcc Patch List, Marek Polacek, Paolo Carlini,
	Jason Merrill, Jonathan Wakely

On 23 October 2014 12:39, Dodji Seketeli <dodji@redhat.com> wrote:
> To take this further, I am thinking that these guidelines would be even
> better served by standing on their own page.  If nobody objects, I can
> create a  DiagnosticsGuidelines page in the wiki with the content that you added.

Since you are already extremely busy with libabigail and I'd prefer if
you spent any free time you may have on reviewing my patches (I would
appreciate your comments to
https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02467.html), I went
ahead and created the new wiki page. I also added a new item about
using expansion_point_location_if_in_system_header for "system macros"
such as NULL.

Cheers,

Manuel.

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

end of thread, other threads:[~2014-11-01 23:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 17:08 C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)) Manuel López-Ibáñez
2014-10-17 17:34 ` Joseph S. Myers
2014-10-17 18:07   ` Manuel López-Ibáñez
2014-10-17 19:26     ` Manuel López-Ibáñez
2014-10-23 10:58       ` C/C++ diagnostics guidelines Dodji Seketeli
2014-10-23 10:40     ` Dodji Seketeli
2014-11-01 23:43       ` Manuel López-Ibáñez

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).