public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Could I obtain the forms needed to make a contribution?
@ 2019-12-16 11:51 Eric Curtin
  2019-12-19 18:23 ` Richard Sandiford
  2019-12-19 19:00 ` Dmitry Grinberg
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Curtin @ 2019-12-16 11:51 UTC (permalink / raw)
  To: gcc

I want to add a compiler warning, if it will get accepted. It's a
-Wlines warning. My employer bans the __LINE__ macro as well as the
ones warned by the -Wdate-time warning, because there is a consensus
that the addition of whitespace or comments should not yield different
binary output for our project. Would this patch get accepted?

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

* Re: Could I obtain the forms needed to make a contribution?
  2019-12-16 11:51 Could I obtain the forms needed to make a contribution? Eric Curtin
@ 2019-12-19 18:23 ` Richard Sandiford
  2019-12-19 19:00 ` Dmitry Grinberg
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Sandiford @ 2019-12-19 18:23 UTC (permalink / raw)
  To: Eric Curtin; +Cc: gcc

Eric Curtin <ericcurtin17@gmail.com> writes:
> I want to add a compiler warning, if it will get accepted. It's a
> -Wlines warning. My employer bans the __LINE__ macro as well as the
> ones warned by the -Wdate-time warning, because there is a consensus
> that the addition of whitespace or comments should not yield different
> binary output for our project. Would this patch get accepted?

Sounds like a useful feature to me FWIW.  Perhaps we should have
a general warning that takes macro names as arguments, with __LINE__
being just one possibility.  That might be over-designing it though. :-)

Richard

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

* Re: Could I obtain the forms needed to make a contribution?
  2019-12-16 11:51 Could I obtain the forms needed to make a contribution? Eric Curtin
  2019-12-19 18:23 ` Richard Sandiford
@ 2019-12-19 19:00 ` Dmitry Grinberg
  2020-01-04  2:23   ` Eric Curtin
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Grinberg @ 2019-12-19 19:00 UTC (permalink / raw)
  To: Eric Curtin; +Cc: gcc

Why not just add "-D__LINE__=LinkerError_LineMacroUsed_DoNotDoThat()" to
CFLAGS?

----
Best Regards,
Dmitry Grinberg


On Mon, Dec 16, 2019 at 3:51 AM Eric Curtin <ericcurtin17@gmail.com> wrote:

> I want to add a compiler warning, if it will get accepted. It's a
> -Wlines warning. My employer bans the __LINE__ macro as well as the
> ones warned by the -Wdate-time warning, because there is a consensus
> that the addition of whitespace or comments should not yield different
> binary output for our project. Would this patch get accepted?
>

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

* Re: Could I obtain the forms needed to make a contribution?
  2019-12-19 19:00 ` Dmitry Grinberg
@ 2020-01-04  2:23   ` Eric Curtin
  2020-01-05 15:34     ` Moritz Strübe
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Curtin @ 2020-01-04  2:23 UTC (permalink / raw)
  To: Dmitry Grinberg; +Cc: gcc

Hi Guys,

Sorry I switched off the email for the holidays.

I guess the problem with the linker error is, we have a distributed
build system with the linking occurring at the very end of the build
(we have a slow build, that's a different problem though).

So it's compile time that this would be preferable like -Wdate-time
does. Would introducing a new warning be the only way to achieve this?
Other than the clever linker way below?

On 19/12/2019, Dmitry Grinberg <dmitrygr@gmail.com> wrote:
> Why not just add "-D__LINE__=LinkerError_LineMacroUsed_DoNotDoThat()" to
> CFLAGS?
>
> ----
> Best Regards,
> Dmitry Grinberg
>
>
> On Mon, Dec 16, 2019 at 3:51 AM Eric Curtin <ericcurtin17@gmail.com> wrote:
>
>> I want to add a compiler warning, if it will get accepted. It's a
>> -Wlines warning. My employer bans the __LINE__ macro as well as the
>> ones warned by the -Wdate-time warning, because there is a consensus
>> that the addition of whitespace or comments should not yield different
>> binary output for our project. Would this patch get accepted?
>>
>

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

* Re: Could I obtain the forms needed to make a contribution?
  2020-01-04  2:23   ` Eric Curtin
@ 2020-01-05 15:34     ` Moritz Strübe
  0 siblings, 0 replies; 5+ messages in thread
From: Moritz Strübe @ 2020-01-05 15:34 UTC (permalink / raw)
  To: gcc

Hey,

you can use Dmitry's solution at compile-time, too. "-D__LINE__={int 
dontUseLine[-1];}"*.
This will most likely trigger an parse-error, because an int is 
expected. And if the code does parse, it will fail at the array-length 
being -1. You'll still might need to turn off some warning, because you 
are overriding a compiler-macro.

Cheers
Morty

*I'm sure there are even better ways to trigger a compile time error, 
but this is what I came up with as a non-expert without having to think 
too much about corner cases. ;)

Am 04.01.2020 um 03:23 schrieb Eric Curtin:
> Hi Guys,
>
> Sorry I switched off the email for the holidays.
>
> I guess the problem with the linker error is, we have a distributed
> build system with the linking occurring at the very end of the build
> (we have a slow build, that's a different problem though).
>
> So it's compile time that this would be preferable like -Wdate-time
> does. Would introducing a new warning be the only way to achieve this?
> Other than the clever linker way below?
>
> On 19/12/2019, Dmitry Grinberg <dmitrygr@gmail.com> wrote:
>> Why not just add "-D__LINE__=LinkerError_LineMacroUsed_DoNotDoThat()" to
>> CFLAGS?
>>
>> ----
>> Best Regards,
>> Dmitry Grinberg
>>
>>
>> On Mon, Dec 16, 2019 at 3:51 AM Eric Curtin <ericcurtin17@gmail.com> wrote:
>>
>>> I want to add a compiler warning, if it will get accepted. It's a
>>> -Wlines warning. My employer bans the __LINE__ macro as well as the
>>> ones warned by the -Wdate-time warning, because there is a consensus
>>> that the addition of whitespace or comments should not yield different
>>> binary output for our project. Would this patch get accepted?
>>>

-- 
Redheads Ltd. Softwaredienstleistungen
Schillerstr. 14
90409 Nürnberg

Telefon: +49 (0)911 180778-50
E-Mail: moritz.struebe@redheads.de | Web: www.redheads.de

Geschäftsführer: Andreas Hanke
Sitz der Gesellschaft: Lauf
Amtsgericht Nürnberg HRB 22681
Ust-ID: DE 249436843


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

end of thread, other threads:[~2020-01-05 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16 11:51 Could I obtain the forms needed to make a contribution? Eric Curtin
2019-12-19 18:23 ` Richard Sandiford
2019-12-19 19:00 ` Dmitry Grinberg
2020-01-04  2:23   ` Eric Curtin
2020-01-05 15:34     ` Moritz Strübe

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