public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* lint kills _Noreturn
@ 2016-05-29 17:21 Ken Brown
  2016-05-29 19:09 ` Ken Brown
  2016-05-29 19:28 ` Andy Moreton
  0 siblings, 2 replies; 12+ messages in thread
From: Ken Brown @ 2016-05-29 17:21 UTC (permalink / raw)
  To: cygwin

If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a 
macro that expands to nothing.  Is this intentional?

Simple test case:

$ cat test.h
#define lint 1
#include <sys/cdefs.h>
_Noreturn void foo (void);

$ gcc -E test.h | grep foo
          void foo (void);


Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 17:21 lint kills _Noreturn Ken Brown
@ 2016-05-29 19:09 ` Ken Brown
  2016-05-29 19:28 ` Andy Moreton
  1 sibling, 0 replies; 12+ messages in thread
From: Ken Brown @ 2016-05-29 19:09 UTC (permalink / raw)
  To: cygwin

On 5/29/2016 9:42 AM, Ken Brown wrote:
> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a
> macro that expands to nothing.  Is this intentional?
> 
> Simple test case:
> 
> $ cat test.h
> #define lint 1
> #include <sys/cdefs.h>
> _Noreturn void foo (void);
> 
> $ gcc -E test.h | grep foo
>          void foo (void);

I would think the following is the right thing here:

--- cdefs.h~    2016-04-21 16:14:57.000000000 -0400
+++ cdefs.h     2016-05-29 11:12:09.326695700 -0400
@@ -277,7 +277,7 @@
  * Keywords added in C11.
  */

-#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint)
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L

 #if !__has_extension(c_alignas)
 #if (defined(__cplusplus) && __cplusplus >= 201103L) || \

I don't see why defining lint should cause C11 keywords to be redefined, but maybe I'm missing something.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 17:21 lint kills _Noreturn Ken Brown
  2016-05-29 19:09 ` Ken Brown
@ 2016-05-29 19:28 ` Andy Moreton
  2016-05-29 22:24   ` Ken Brown
  1 sibling, 1 reply; 12+ messages in thread
From: Andy Moreton @ 2016-05-29 19:28 UTC (permalink / raw)
  To: cygwin

On Sun 29 May 2016, Ken Brown wrote:

> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a macro
> that expands to nothing.  Is this intentional?
>
> Simple test case:
>
> $ cat test.h
> #define lint 1
> #include <sys/cdefs.h>
> _Noreturn void foo (void);
>
> $ gcc -E test.h | grep foo
>          void foo (void);
>
>
> Ken

A traditional lint program may not support the new C11 keywords, but
will define the 'lint' symbol. See, e.g.
     http://www.unix.com/man-page/FreeBSD/1/lint

Surely the real problem here is a program which is not a lint executable
defining 'lint' ?

    AndyM


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 19:28 ` Andy Moreton
@ 2016-05-29 22:24   ` Ken Brown
  2016-05-29 22:51     ` Ken Brown
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ken Brown @ 2016-05-29 22:24 UTC (permalink / raw)
  To: cygwin

On 5/29/2016 12:56 PM, Andy Moreton wrote:
> On Sun 29 May 2016, Ken Brown wrote:
>
>> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a macro
>> that expands to nothing.  Is this intentional?
>>
>> Simple test case:
>>
>> $ cat test.h
>> #define lint 1
>> #include <sys/cdefs.h>
>> _Noreturn void foo (void);
>>
>> $ gcc -E test.h | grep foo
>>          void foo (void);
>>
>>
>> Ken
>
> A traditional lint program may not support the new C11 keywords, but
> will define the 'lint' symbol. See, e.g.
>      http://www.unix.com/man-page/FreeBSD/1/lint

But in the present context (see my second message), we're redefining C11 
keywords even though __STDC_VERSION__ >= 201112L.

> Surely the real problem here is a program which is not a lint executable
> defining 'lint' ?

The program is emacs built from a git checkout of the master branch.  By 
default the configure option --enable-gcc-checking is used, and this 
causes lint to be defined in src/config.h.  It doesn't seem to be a 
problem on platforms other than Cygwin; or at least it hasn't been reported.

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 22:24   ` Ken Brown
@ 2016-05-29 22:51     ` Ken Brown
  2016-05-30  7:19     ` Andy Moreton
  2016-05-30 10:35     ` Corinna Vinschen
  2 siblings, 0 replies; 12+ messages in thread
From: Ken Brown @ 2016-05-29 22:51 UTC (permalink / raw)
  To: cygwin

On 5/29/2016 1:21 PM, Ken Brown wrote:
> On 5/29/2016 12:56 PM, Andy Moreton wrote:
>> On Sun 29 May 2016, Ken Brown wrote:
>>
>>> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn
>>> as a macro
>>> that expands to nothing.  Is this intentional?
>>>
>>> Simple test case:
>>>
>>> $ cat test.h
>>> #define lint 1
>>> #include <sys/cdefs.h>
>>> _Noreturn void foo (void);
>>>
>>> $ gcc -E test.h | grep foo
>>>          void foo (void);
>>>
>>>
>>> Ken
>>
>> A traditional lint program may not support the new C11 keywords, but
>> will define the 'lint' symbol. See, e.g.
>>      http://www.unix.com/man-page/FreeBSD/1/lint
>
> But in the present context (see my second message), we're redefining C11
> keywords even though __STDC_VERSION__ >= 201112L.
>
>> Surely the real problem here is a program which is not a lint executable
>> defining 'lint' ?
>
> The program is emacs built from a git checkout of the master branch.  By
> default the configure option --enable-gcc-checking is used, and this

I meant --enable-gcc-warnings.

> causes lint to be defined in src/config.h.  It doesn't seem to be a
> problem on platforms other than Cygwin; or at least it hasn't been
> reported.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 22:24   ` Ken Brown
  2016-05-29 22:51     ` Ken Brown
@ 2016-05-30  7:19     ` Andy Moreton
  2016-05-30  8:25       ` Ken Brown
  2016-05-30 10:35     ` Corinna Vinschen
  2 siblings, 1 reply; 12+ messages in thread
From: Andy Moreton @ 2016-05-30  7:19 UTC (permalink / raw)
  To: cygwin

On Sun 29 May 2016, Ken Brown wrote:

> On 5/29/2016 12:56 PM, Andy Moreton wrote:
>> On Sun 29 May 2016, Ken Brown wrote:
>>
>>> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a macro
>>> that expands to nothing.  Is this intentional?
>>>
>>> Simple test case:
>>>
>>> $ cat test.h
>>> #define lint 1
>>> #include <sys/cdefs.h>
>>> _Noreturn void foo (void);
>>>
>>> $ gcc -E test.h | grep foo
>>>          void foo (void);
>>>
>>>
>>> Ken
>>
>> A traditional lint program may not support the new C11 keywords, but
>> will define the 'lint' symbol. See, e.g.
>>      http://www.unix.com/man-page/FreeBSD/1/lint
>
> But in the present context (see my second message), we're redefining C11
> keywords even though __STDC_VERSION__ >= 201112L.

Agreed, but that should only affect a lint program that understands C11.
Any other program should simply not be defining lint in the first place.

>> Surely the real problem here is a program which is not a lint executable
>> defining 'lint' ?
>
> The program is emacs built from a git checkout of the master branch.  By
> default the configure option --enable-gcc-checking is used, and this causes
> lint to be defined in src/config.h.  It doesn't seem to be a problem on
> platforms other than Cygwin; or at least it hasn't been reported.

I saw your report of emacs bug#23640, and followed here. I think the
real question is why the recent change to emacs configure.ac added a
definition of lint - that seems wrong.

    AndyM


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-30  7:19     ` Andy Moreton
@ 2016-05-30  8:25       ` Ken Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Ken Brown @ 2016-05-30  8:25 UTC (permalink / raw)
  To: cygwin

On 5/29/2016 3:09 PM, Andy Moreton wrote:
> On Sun 29 May 2016, Ken Brown wrote:
>
>> On 5/29/2016 12:56 PM, Andy Moreton wrote:
>>> On Sun 29 May 2016, Ken Brown wrote:
>>>
>>>> If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a macro
>>>> that expands to nothing.  Is this intentional?
>>>>
>>>> Simple test case:
>>>>
>>>> $ cat test.h
>>>> #define lint 1
>>>> #include <sys/cdefs.h>
>>>> _Noreturn void foo (void);
>>>>
>>>> $ gcc -E test.h | grep foo
>>>>          void foo (void);
>>>>
>>>>
>>>> Ken
>>>
>>> A traditional lint program may not support the new C11 keywords, but
>>> will define the 'lint' symbol. See, e.g.
>>>      http://www.unix.com/man-page/FreeBSD/1/lint
>>
>> But in the present context (see my second message), we're redefining C11
>> keywords even though __STDC_VERSION__ >= 201112L.
>
> Agreed, but that should only affect a lint program that understands C11.
> Any other program should simply not be defining lint in the first place.
>
>>> Surely the real problem here is a program which is not a lint executable
>>> defining 'lint' ?
>>
>> The program is emacs built from a git checkout of the master branch.  By
>> default the configure option --enable-gcc-checking is used, and this causes
>> lint to be defined in src/config.h.  It doesn't seem to be a problem on
>> platforms other than Cygwin; or at least it hasn't been reported.
>
> I saw your report of emacs bug#23640, and followed here. I think the
> real question is why the recent change to emacs configure.ac added a
> definition of lint - that seems wrong.

That was actually added about 4 years ago, in commit b8df54f, when the 
--enable-gcc-warnings option was first added.  The only thing that 
changed recently was that the warnings are enabled by default on a git 
checkout of master.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-29 22:24   ` Ken Brown
  2016-05-29 22:51     ` Ken Brown
  2016-05-30  7:19     ` Andy Moreton
@ 2016-05-30 10:35     ` Corinna Vinschen
  2016-05-30 21:57       ` Hans-Bernhard Bröker
  2016-05-31  9:35       ` Ken Brown
  2 siblings, 2 replies; 12+ messages in thread
From: Corinna Vinschen @ 2016-05-30 10:35 UTC (permalink / raw)
  To: cygwin

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

On May 29 13:21, Ken Brown wrote:
> On 5/29/2016 12:56 PM, Andy Moreton wrote:
> > On Sun 29 May 2016, Ken Brown wrote:
> > 
> > > If lint is defined, then /usr/include/sys/cdefs.h defines _Noreturn as a macro
> > > that expands to nothing.  Is this intentional?
> > > 
> > > Simple test case:
> > > 
> > > $ cat test.h
> > > #define lint 1
> > > #include <sys/cdefs.h>
> > > _Noreturn void foo (void);
> > > 
> > > $ gcc -E test.h | grep foo
> > >          void foo (void);
> > > 
> > > 
> > > Ken
> > 
> > A traditional lint program may not support the new C11 keywords, but
> > will define the 'lint' symbol. See, e.g.
> >      http://www.unix.com/man-page/FreeBSD/1/lint
> 
> But in the present context (see my second message), we're redefining C11
> keywords even though __STDC_VERSION__ >= 201112L.
> 
> > Surely the real problem here is a program which is not a lint executable
> > defining 'lint' ?
> 
> The program is emacs built from a git checkout of the master branch.  By
> default the configure option --enable-gcc-checking is used, and this causes
> lint to be defined in src/config.h.  It doesn't seem to be a problem on
> platforms other than Cygwin; or at least it hasn't been reported.

Our cdefs.h is taken almost verbatim from FreeBSD, and FreeBSD's
cdefs.h uses the exact same expressions chcking for lint.  I'm sure
you'd see the same problems there.  Don't set lint.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: lint kills _Noreturn
  2016-05-30 10:35     ` Corinna Vinschen
@ 2016-05-30 21:57       ` Hans-Bernhard Bröker
  2016-05-31  9:35       ` Ken Brown
  1 sibling, 0 replies; 12+ messages in thread
From: Hans-Bernhard Bröker @ 2016-05-30 21:57 UTC (permalink / raw)
  To: cygwin

Am 30.05.2016 um 10:44 schrieb Corinna Vinschen:

> Our cdefs.h is taken almost verbatim from FreeBSD, and FreeBSD's
> cdefs.h uses the exact same expressions chcking for lint.

That means almost nothing.  The BSD guy might have a good, 
platform-specific reason to assign a specific meaning to the macro 
"lint" that's buried in their history, and doesn't even apply to Cygwin. 
  And of course like everybody else, they could simply have got it wrong.

 > Don't set lint.

It's not that simple.

On the one hand the global name "lint" is clearly in the user's name 
space.  If an implementation wants to use a macro that means something 
special, and which user code is not supposed to meddle with, that's what 
the language has reserved name space patterns for (it should then be 
__lint or __LINT).

OTOH the original lint, although it's a tool that's used to check for 
violations of such rules among others, unfortunately used to violate 
those same rules by predefining a global macro "lint", and existing code 
still relies on that property to hide non-standard constructs like that 
_Noreturn from lint.

Disappointingly the more modern implementations of lint still get this 
wrong, or at least not quite right, in different ways:  splint documents 
"S_SPLINT_S", which at least looks like a macro, but is still in user 
namespace.  Gimpel's ones have "_lint", which is better than "lint", but 
should really be "__lint".


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-30 10:35     ` Corinna Vinschen
  2016-05-30 21:57       ` Hans-Bernhard Bröker
@ 2016-05-31  9:35       ` Ken Brown
  2016-05-31  9:41         ` Ken Brown
  1 sibling, 1 reply; 12+ messages in thread
From: Ken Brown @ 2016-05-31  9:35 UTC (permalink / raw)
  To: cygwin

On 5/30/2016 4:44 AM, Corinna Vinschen wrote:
> Our cdefs.h is taken almost verbatim from FreeBSD, and FreeBSD's
> cdefs.h uses the exact same expressions chcking for lint.  I'm sure
> you'd see the same problems there.  Don't set lint.

OK, emacs has now been changed so that it no longer defines lint.  If 
you're interested in Paul Eggert's take on this issue, see

   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23640#26

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-31  9:35       ` Ken Brown
@ 2016-05-31  9:41         ` Ken Brown
  2016-05-31 17:03           ` Corinna Vinschen
  0 siblings, 1 reply; 12+ messages in thread
From: Ken Brown @ 2016-05-31  9:41 UTC (permalink / raw)
  To: cygwin

On 5/30/2016 8:14 PM, Ken Brown wrote:
> On 5/30/2016 4:44 AM, Corinna Vinschen wrote:
>> Our cdefs.h is taken almost verbatim from FreeBSD, and FreeBSD's
>> cdefs.h uses the exact same expressions chcking for lint.  I'm sure
>> you'd see the same problems there.  Don't set lint.
>
> OK, emacs has now been changed so that it no longer defines lint.  If
> you're interested in Paul Eggert's take on this issue, see
>
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23640#26

And https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209877 .

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: lint kills _Noreturn
  2016-05-31  9:41         ` Ken Brown
@ 2016-05-31 17:03           ` Corinna Vinschen
  0 siblings, 0 replies; 12+ messages in thread
From: Corinna Vinschen @ 2016-05-31 17:03 UTC (permalink / raw)
  To: cygwin

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

On May 30 21:47, Ken Brown wrote:
> On 5/30/2016 8:14 PM, Ken Brown wrote:
> > On 5/30/2016 4:44 AM, Corinna Vinschen wrote:
> > > Our cdefs.h is taken almost verbatim from FreeBSD, and FreeBSD's
> > > cdefs.h uses the exact same expressions chcking for lint.  I'm sure
> > > you'd see the same problems there.  Don't set lint.
> > 
> > OK, emacs has now been changed so that it no longer defines lint.  If
> > you're interested in Paul Eggert's take on this issue, see
> > 
> >   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23640#26
> 
> And https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209877 .

That reminds me of my latest FreeBSD bugzilla report, including
patch submission.  It's lingering since 2013...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-05-31  9:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-29 17:21 lint kills _Noreturn Ken Brown
2016-05-29 19:09 ` Ken Brown
2016-05-29 19:28 ` Andy Moreton
2016-05-29 22:24   ` Ken Brown
2016-05-29 22:51     ` Ken Brown
2016-05-30  7:19     ` Andy Moreton
2016-05-30  8:25       ` Ken Brown
2016-05-30 10:35     ` Corinna Vinschen
2016-05-30 21:57       ` Hans-Bernhard Bröker
2016-05-31  9:35       ` Ken Brown
2016-05-31  9:41         ` Ken Brown
2016-05-31 17:03           ` Corinna Vinschen

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