public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: cygwin-1.7.28 getpwent header declaration changes ?
@ 2014-02-07  9:27 Jan Nijtmans
  2014-02-07  9:29 ` Corinna Vinschen
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Nijtmans @ 2014-02-07  9:27 UTC (permalink / raw)
  To: cygwin

2014-02-06 15:41 GMT+01:00 Corinna Vinschen:
> Jan, can you please check if SQlite builds *without* defining
> __BSD_VISIBLE, but adding the following lines to /usr/include/sys/file.h;

That addition makes SQLite build fine again. You can try it easily
by installing the "sqlite3-debug" package and then:

    gcc -c /usr/src/debug/sqlite3-3.8.3-2/sqlite3.c

If this command produces an "sqlite3.o" file in the
current directory without complaining, everything is OK.
(The current sqlite3-3.8.3-2 package doesn't set
__BSD_VISIBLE, and with your proposed change
it won't be necessary to add it)

Thank you very much!

Regards,
       Jan Nijtmans

> Index: sys/file.h
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/include/sys/file.h,v
> retrieving revision 1.8
> diff -u -p -r1.8 file.h
> --- sys/file.h  17 Jan 2014 11:01:46 -0000      1.8
> +++ sys/file.h  6 Feb 2014 14:41:23 -0000
> @@ -31,4 +31,16 @@
>  #define L_INCR         SEEK_CUR
>  #define L_XTND         SEEK_END
>
> +/* Including <sys/file.h> always defines flock & macros. */
> +#if __BSD_VISIBLE - 0  == 0
> +
> +#define LOCK_SH                0x01            /* shared file lock */
> +#define LOCK_EX                0x02            /* exclusive file lock */
> +#define LOCK_NB                0x04            /* don't block when locking */
> +#define LOCK_UN                0x08            /* unlock file */
> +
> +extern int flock _PARAMS ((int, int));
> +
> +#endif
> +
>  #endif

--
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] 13+ messages in thread

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-07  9:27 cygwin-1.7.28 getpwent header declaration changes ? Jan Nijtmans
@ 2014-02-07  9:29 ` Corinna Vinschen
  0 siblings, 0 replies; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-07  9:29 UTC (permalink / raw)
  To: cygwin

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

On Feb  7 10:27, Jan Nijtmans wrote:
> 2014-02-06 15:41 GMT+01:00 Corinna Vinschen:
> > Jan, can you please check if SQlite builds *without* defining
> > __BSD_VISIBLE, but adding the following lines to /usr/include/sys/file.h;
> 
> That addition makes SQLite build fine again. You can try it easily
> by installing the "sqlite3-debug" package and then:
> 
>     gcc -c /usr/src/debug/sqlite3-3.8.3-2/sqlite3.c
> 
> If this command produces an "sqlite3.o" file in the
> current directory without complaining, everything is OK.
> (The current sqlite3-3.8.3-2 package doesn't set
> __BSD_VISIBLE, and with your proposed change
> it won't be necessary to add it)
> 
> Thank you very much!

Thanks for testing.  I applied the patch to CVS.


Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-09 20:20     ` Corinna Vinschen
@ 2014-02-10 16:14       ` Marco Atzeri
  0 siblings, 0 replies; 13+ messages in thread
From: Marco Atzeri @ 2014-02-10 16:14 UTC (permalink / raw)
  To: cygwin

On 09/02/2014 21:09, Corinna Vinschen wrote:
> On Feb  9 20:50, Marco Atzeri wrote:
>>
>>

>>
>> probably I am missing something obvious, but should not
>>
>> /usr/include/sys/cdefs.h
>>
>> be included in some way in
>> /usr/include/pwd.h
>>
>> to make working the
>>
>>      #if __XSI_VISIBLE >= 500
>>      struct passwd   *getpwent (void);
>>      void             setpwent (void);
>>      void             endpwent (void);
>>      #endif
>>
>> ?
>
> You are oh so right.  I'm just uploading a new cygwin-1.7.18-2
> package which fixes this and the sys/file.h bug.
>
>
> HTH,
> Corinna
>

works as charm

Tschüs
Marco

--
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] 13+ messages in thread

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-09 20:06   ` Marco Atzeri
@ 2014-02-09 20:20     ` Corinna Vinschen
  2014-02-10 16:14       ` Marco Atzeri
  0 siblings, 1 reply; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-09 20:20 UTC (permalink / raw)
  To: cygwin

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

On Feb  9 20:50, Marco Atzeri wrote:
> 
> 
> On 06/02/2014 10:01, Corinna Vinschen wrote:
> >On Feb  6 08:29, Marco Atzeri wrote:
> >>on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
> >>(only system difference) compiling octave I see:
> >>
> >>----------------------------------------------------------------
> >>/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
> >>:114:25: error: '::getpwent' has not been declared
> >>    return octave_passwd (::getpwent (), msg);
> >>                          ^
> >>[...]
> >>Is something slightly changed in the  relative system headers ?
> >
> >I don't know anything about octave, but what has changed is that newlib
> >is finally introducing BSD-like visibility macros.  The pwd.h header now
> >contains this:
> >
> >   #if __XSI_VISIBLE >= 500
> >   struct passwd   *getpwent (void);
> >   void             setpwent (void);
> >   void             endpwent (void);
> >   #endif
> >
> >The default settings per the sys/cdefs.h header are:
> >
> >   #define __POSIX_VISIBLE         200809
> >   #define __XSI_VISIBLE           700
> >   #define __BSD_VISIBLE           1
> >   #define __ISO_C_VISIBLE         2011
> >
> >unless your environment defines one of
> >
> >   _XOPEN_SOURCE
> >   _POSIX_C_SOURCE
> >   _ANSI_SOURCE
> >   _C99_SOURCE
> >   _C11_SOURCE
> >   _GNU_SOURCE
> >
> >Have a look at the end of /usr/include/sys/cdefs.h, it explains things.
> >
> >
> >Corinna
> >
> 
> probably I am missing something obvious, but should not
> 
> /usr/include/sys/cdefs.h
> 
> be included in some way in
> /usr/include/pwd.h
> 
> to make working the
> 
>     #if __XSI_VISIBLE >= 500
>     struct passwd   *getpwent (void);
>     void             setpwent (void);
>     void             endpwent (void);
>     #endif
> 
> ?

You are oh so right.  I'm just uploading a new cygwin-1.7.18-2
package which fixes this and the sys/file.h bug.


HTH,
Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06  9:01 ` Corinna Vinschen
  2014-02-06 10:20   ` Marco Atzeri
@ 2014-02-09 20:06   ` Marco Atzeri
  2014-02-09 20:20     ` Corinna Vinschen
  1 sibling, 1 reply; 13+ messages in thread
From: Marco Atzeri @ 2014-02-09 20:06 UTC (permalink / raw)
  To: cygwin



On 06/02/2014 10:01, Corinna Vinschen wrote:
> On Feb  6 08:29, Marco Atzeri wrote:
>> on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
>> (only system difference) compiling octave I see:
>>
>> ----------------------------------------------------------------
>> /pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
>> :114:25: error: '::getpwent' has not been declared
>>     return octave_passwd (::getpwent (), msg);
>>                           ^
>> [...]
>> Is something slightly changed in the  relative system headers ?
>
> I don't know anything about octave, but what has changed is that newlib
> is finally introducing BSD-like visibility macros.  The pwd.h header now
> contains this:
>
>    #if __XSI_VISIBLE >= 500
>    struct passwd   *getpwent (void);
>    void             setpwent (void);
>    void             endpwent (void);
>    #endif
>
> The default settings per the sys/cdefs.h header are:
>
>    #define __POSIX_VISIBLE         200809
>    #define __XSI_VISIBLE           700
>    #define __BSD_VISIBLE           1
>    #define __ISO_C_VISIBLE         2011
>
> unless your environment defines one of
>
>    _XOPEN_SOURCE
>    _POSIX_C_SOURCE
>    _ANSI_SOURCE
>    _C99_SOURCE
>    _C11_SOURCE
>    _GNU_SOURCE
>
> Have a look at the end of /usr/include/sys/cdefs.h, it explains things.
>
>
> Corinna
>

probably I am missing something obvious, but should not

/usr/include/sys/cdefs.h

be included in some way in
/usr/include/pwd.h

to make working the

     #if __XSI_VISIBLE >= 500
     struct passwd   *getpwent (void);
     void             setpwent (void);
     void             endpwent (void);
     #endif

?

Regards
Marco



--
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] 13+ messages in thread

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06 14:28             ` Corinna Vinschen
@ 2014-02-06 14:41               ` Corinna Vinschen
  0 siblings, 0 replies; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-06 14:41 UTC (permalink / raw)
  To: cygwin

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

On Feb  6 15:28, Corinna Vinschen wrote:
> On Feb  6 15:15, Jan Nijtmans wrote:
> > 2014-02-06 15:02 GMT+01:00 Corinna Vinschen:
> > > In sys/_default_fcntl.h, the LOCK_xx macros are defined if
> > > __BSD_VISIBLE is defined, which *is* defined by default, unless you
> > > define one of
> > >
> > >   _ANSI_SOURCE
> > >   _C99_SOURCE
> > >   _C11_SOURCE
> > >   _POSIX_C_SOURCE
> > >   _XOPEN_SOURCE
> > 
> > Yes, SQLite defines _XOPEN_SOURCE in sqliteInt.h:
> > 
> >     <http://www.sqlite.org/src/artifact/fdab572b3567d587?ln=198-200>
> > 
> > I could add a !defined(__CYGWIN__) there, but I prefer
> > just to define __BSD_VISIBLE.
> 
> On second thought, Linux defines the LOCK_xx macros unconditionally
> in sys/file.h.  What we could do is to define the macros in sys/file.h
> if they are not already defined because __BSD_VISIBLE wasn't set.

Jan, can you please check if SQlite builds *without* defining
__BSD_VISIBLE, but adding the following lines to /usr/include/sys/file.h;

Index: sys/file.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/sys/file.h,v
retrieving revision 1.8
diff -u -p -r1.8 file.h
--- sys/file.h	17 Jan 2014 11:01:46 -0000	1.8
+++ sys/file.h	6 Feb 2014 14:41:23 -0000
@@ -31,4 +31,16 @@
 #define L_INCR		SEEK_CUR
 #define L_XTND		SEEK_END
 
+/* Including <sys/file.h> always defines flock & macros. */
+#if __BSD_VISIBLE - 0  == 0
+
+#define LOCK_SH		0x01		/* shared file lock */
+#define LOCK_EX		0x02		/* exclusive file lock */
+#define LOCK_NB		0x04		/* don't block when locking */
+#define LOCK_UN		0x08		/* unlock file */
+
+extern int flock _PARAMS ((int, int));
+
+#endif
+
 #endif


Thanks in advance,
Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06 14:15           ` Fwd: " Jan Nijtmans
@ 2014-02-06 14:28             ` Corinna Vinschen
  2014-02-06 14:41               ` Corinna Vinschen
  0 siblings, 1 reply; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-06 14:28 UTC (permalink / raw)
  To: cygwin

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

On Feb  6 15:15, Jan Nijtmans wrote:
> 2014-02-06 15:02 GMT+01:00 Corinna Vinschen:
> > In sys/_default_fcntl.h, the LOCK_xx macros are defined if
> > __BSD_VISIBLE is defined, which *is* defined by default, unless you
> > define one of
> >
> >   _ANSI_SOURCE
> >   _C99_SOURCE
> >   _C11_SOURCE
> >   _POSIX_C_SOURCE
> >   _XOPEN_SOURCE
> 
> Yes, SQLite defines _XOPEN_SOURCE in sqliteInt.h:
> 
>     <http://www.sqlite.org/src/artifact/fdab572b3567d587?ln=198-200>
> 
> I could add a !defined(__CYGWIN__) there, but I prefer
> just to define __BSD_VISIBLE.

On second thought, Linux defines the LOCK_xx macros unconditionally
in sys/file.h.  What we could do is to define the macros in sys/file.h
if they are not already defined because __BSD_VISIBLE wasn't set.


Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06 10:20   ` Marco Atzeri
  2014-02-06 13:00     ` Jan Nijtmans
@ 2014-02-06 14:13     ` Corinna Vinschen
  1 sibling, 0 replies; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-06 14:13 UTC (permalink / raw)
  To: cygwin

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

On Feb  6 11:19, Marco Atzeri wrote:
> 
> 
> On 06/02/2014 10:01, Corinna Vinschen wrote:
> >On Feb  6 08:29, Marco Atzeri wrote:
> >>on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
> >>(only system difference) compiling octave I see:
> >>
> >>----------------------------------------------------------------
> >>/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
> >>:114:25: error: '::getpwent' has not been declared
> >>    return octave_passwd (::getpwent (), msg);
> >>                          ^
> >>[...]
> >>Is something slightly changed in the  relative system headers ?
> >
> >I don't know anything about octave, but what has changed is that newlib
> >is finally introducing BSD-like visibility macros.  The pwd.h header now
> >contains this:
> >
> >   #if __XSI_VISIBLE >= 500
> >   struct passwd   *getpwent (void);
> >   void             setpwent (void);
> >   void             endpwent (void);
> >   #endif
> > [...]
> 
> thanks for the hints
> 
> for what I can see  "_GNU_SOURCE" is defined in both cases at
> configure stage and reported in config.status and config.h
> 
> I will look to compare the preprocessor output to see why building
> on  1.7.28 the "/* Everything and the kitchen sink. */" is not pulled in

Btw., it would be a good idea to get rid of calls to getpwent/getgrent
in future.  They *probably* won't do anymore what they were supposed to
do if you don't have passwd/group files.  A full implementation would
require to enumerate the local SAM and, at least, the primary domain
accounts at runtime.  That would be possible, but it comes at a hefty
price in terms of performance.


Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06 13:00     ` Jan Nijtmans
@ 2014-02-06 14:02       ` Corinna Vinschen
       [not found]         ` <CAO1jNws3H_Wbec=y_UoYkhrb5nMX7iT7_A5XaHcQKCw32o055g@mail.gmail.com>
  0 siblings, 1 reply; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-06 14:02 UTC (permalink / raw)
  To: cygwin

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

On Feb  6 14:00, Jan Nijtmans wrote:
> On Feb  6 08:29, Marco Atzeri wrote:
> > Is something slightly changed in the  relative system headers ?
> 
> After upgrading to Cygwin 1.7.28, Sqlite doesn't compile any
> more. See log below. When reverting to 1.7.27-2,
> everything is back to normal.
> 
> The LOCK_EX macro's and friends are supposed to
> be defined when including <sys/file.h>:
>     <http://man7.org/linux/man-pages/man2/flock.2.html>
> but they aren't any more.

They are.  There's an #include <fcntl.h> in sys/file.h, which in
turn includes sys/fcntl.h which includes sys/_default_fcntl.h.

In sys/_default_fcntl.h, the LOCK_xx macros are defined if
__BSD_VISIBLE is defined, which *is* defined by default, unless you
define one of

  _ANSI_SOURCE
  _C99_SOURCE
  _C11_SOURCE
  _POSIX_C_SOURCE
  _XOPEN_SOURCE


Corinna

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

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

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

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06 10:20   ` Marco Atzeri
@ 2014-02-06 13:00     ` Jan Nijtmans
  2014-02-06 14:02       ` Corinna Vinschen
  2014-02-06 14:13     ` Corinna Vinschen
  1 sibling, 1 reply; 13+ messages in thread
From: Jan Nijtmans @ 2014-02-06 13:00 UTC (permalink / raw)
  To: cygwin

On Feb  6 08:29, Marco Atzeri wrote:
> Is something slightly changed in the  relative system headers ?

After upgrading to Cygwin 1.7.28, Sqlite doesn't compile any
more. See log below. When reverting to 1.7.27-2,
everything is back to normal.

The LOCK_EX macro's and friends are supposed to
be defined when including <sys/file.h>:
    <http://man7.org/linux/man-pages/man2/flock.2.html>
but they aren't any more.

I added a:
    #define __BSD_VISIBLE 1
to sqliteInt.h (before all headers are included), then
everything works again.

Regards,
       Jan Nijtmans

==============================================
sqlite3.c: In function 'flockCheckReservedLock':
sqlite3.c:25869:38: error: 'LOCK_EX' undeclared (first use in this function)
     int lrc = robust_flock(pFile->h, LOCK_EX | LOCK_NB);
                                      ^
sqlite3.c:25869:38: note: each undeclared identifier is reported only
once for e         ach function it appears in
sqlite3.c:25869:48: error: 'LOCK_NB' undeclared (first use in this function)
     int lrc = robust_flock(pFile->h, LOCK_EX | LOCK_NB);
                                                ^
sqlite3.c:25872:36: error: 'LOCK_UN' undeclared (first use in this function)
       lrc = robust_flock(pFile->h, LOCK_UN);
                                    ^
sqlite3.c: In function 'flockLock':
sqlite3.c:25949:30: error: 'LOCK_EX' undeclared (first use in this function)
   if (robust_flock(pFile->h, LOCK_EX | LOCK_NB)) {
                              ^
sqlite3.c:25949:40: error: 'LOCK_NB' undeclared (first use in this function)
   if (robust_flock(pFile->h, LOCK_EX | LOCK_NB)) {
                                        ^
sqlite3.c: In function 'flockUnlock':
sqlite3.c:25998:30: error: 'LOCK_UN' undeclared (first use in this function)
   if( robust_flock(pFile->h, LOCK_UN) ){
                              ^
Makefile:563: recipe for target 'sqlite3.lo' failed
make: *** [sqlite3.lo] Error 1

--
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] 13+ messages in thread

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06  9:01 ` Corinna Vinschen
@ 2014-02-06 10:20   ` Marco Atzeri
  2014-02-06 13:00     ` Jan Nijtmans
  2014-02-06 14:13     ` Corinna Vinschen
  2014-02-09 20:06   ` Marco Atzeri
  1 sibling, 2 replies; 13+ messages in thread
From: Marco Atzeri @ 2014-02-06 10:20 UTC (permalink / raw)
  To: cygwin



On 06/02/2014 10:01, Corinna Vinschen wrote:
> On Feb  6 08:29, Marco Atzeri wrote:
>> on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
>> (only system difference) compiling octave I see:
>>
>> ----------------------------------------------------------------
>> /pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
>> :114:25: error: '::getpwent' has not been declared
>>     return octave_passwd (::getpwent (), msg);
>>                           ^
>> [...]
>> Is something slightly changed in the  relative system headers ?
>
> I don't know anything about octave, but what has changed is that newlib
> is finally introducing BSD-like visibility macros.  The pwd.h header now
> contains this:
>
>    #if __XSI_VISIBLE >= 500
>    struct passwd   *getpwent (void);
>    void             setpwent (void);
>    void             endpwent (void);
>    #endif
>
> The default settings per the sys/cdefs.h header are:
>
>    #define __POSIX_VISIBLE         200809
>    #define __XSI_VISIBLE           700
>    #define __BSD_VISIBLE           1
>    #define __ISO_C_VISIBLE         2011
>
> unless your environment defines one of
>
>    _XOPEN_SOURCE
>    _POSIX_C_SOURCE
>    _ANSI_SOURCE
>    _C99_SOURCE
>    _C11_SOURCE
>    _GNU_SOURCE
>
> Have a look at the end of /usr/include/sys/cdefs.h, it explains things.
>
>
> Corinna

thanks for the hints

for what I can see  "_GNU_SOURCE" is defined in both cases at
configure stage and reported in config.status and config.h

I will look to compare the preprocessor output to see why building
on  1.7.28 the "/* Everything and the kitchen sink. */" is not pulled in

Regards
Marco







--
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] 13+ messages in thread

* Re: cygwin-1.7.28 getpwent header declaration changes ?
  2014-02-06  7:29 Marco Atzeri
@ 2014-02-06  9:01 ` Corinna Vinschen
  2014-02-06 10:20   ` Marco Atzeri
  2014-02-09 20:06   ` Marco Atzeri
  0 siblings, 2 replies; 13+ messages in thread
From: Corinna Vinschen @ 2014-02-06  9:01 UTC (permalink / raw)
  To: cygwin

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

On Feb  6 08:29, Marco Atzeri wrote:
> on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
> (only system difference) compiling octave I see:
> 
> ----------------------------------------------------------------
> /pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
> :114:25: error: '::getpwent' has not been declared
>    return octave_passwd (::getpwent (), msg);
>                          ^
> [...]
> Is something slightly changed in the  relative system headers ?

I don't know anything about octave, but what has changed is that newlib
is finally introducing BSD-like visibility macros.  The pwd.h header now
contains this:

  #if __XSI_VISIBLE >= 500
  struct passwd   *getpwent (void);
  void             setpwent (void);
  void             endpwent (void);
  #endif

The default settings per the sys/cdefs.h header are:

  #define __POSIX_VISIBLE         200809
  #define __XSI_VISIBLE           700
  #define __BSD_VISIBLE           1
  #define __ISO_C_VISIBLE         2011

unless your environment defines one of

  _XOPEN_SOURCE
  _POSIX_C_SOURCE
  _ANSI_SOURCE
  _C99_SOURCE
  _C11_SOURCE
  _GNU_SOURCE

Have a look at the end of /usr/include/sys/cdefs.h, it explains things.


Corinna

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

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

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

* cygwin-1.7.28 getpwent header declaration changes ?
@ 2014-02-06  7:29 Marco Atzeri
  2014-02-06  9:01 ` Corinna Vinschen
  0 siblings, 1 reply; 13+ messages in thread
From: Marco Atzeri @ 2014-02-06  7:29 UTC (permalink / raw)
  To: cygwin

on cygwin-1.7.28 64 bit but not on cygwin-1.7.27,
(only system difference) compiling octave I see:

----------------------------------------------------------------
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
:114:25: error: '::getpwent' has not been declared
    return octave_passwd (::getpwent (), msg);
                          ^
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
: In static member function 'static int 
octave_passwd::setpwent(std::string&)':
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
:171:3: error: '::setpwent' has not been declared
    ::setpwent ();
    ^
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
: In static member function 'static int 
octave_passwd::endpwent(std::string&)':
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
:191:3: error: '::endpwent' has not been declared
    ::endpwent ();
    ^
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
: In static member function 'static octave_passwd 
octave_passwd::getpwent(std::s
tring&)':
/pub/devel/octave/octave-3.8.0-2/src/octave-3.8.0/liboctave/system/oct-passwd.cc
:119:1: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^
Makefile:8702: recipe for target 
'system/system_libsystem_la-oct-passwd.lo' fail
ed
make[4]: *** [system/system_libsystem_la-oct-passwd.lo] Error 1

----------------------------------------------------------------

the piece of code is a very simple:
-----------------------------------------------
octave_passwd
octave_passwd::getpwent (std::string& msg)
{
#if defined HAVE_GETPWENT
   msg = std::string ();
   return octave_passwd (::getpwent (), msg);
#else
   msg = NOT_SUPPORTED ("getpwent");
   return octave_passwd ();
#endif
}

----------------------------------------

Is something slightly changed in the  relative system headers ?

Regards
Marco


--
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] 13+ messages in thread

end of thread, other threads:[~2014-02-10 14:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07  9:27 cygwin-1.7.28 getpwent header declaration changes ? Jan Nijtmans
2014-02-07  9:29 ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2014-02-06  7:29 Marco Atzeri
2014-02-06  9:01 ` Corinna Vinschen
2014-02-06 10:20   ` Marco Atzeri
2014-02-06 13:00     ` Jan Nijtmans
2014-02-06 14:02       ` Corinna Vinschen
     [not found]         ` <CAO1jNws3H_Wbec=y_UoYkhrb5nMX7iT7_A5XaHcQKCw32o055g@mail.gmail.com>
2014-02-06 14:15           ` Fwd: " Jan Nijtmans
2014-02-06 14:28             ` Corinna Vinschen
2014-02-06 14:41               ` Corinna Vinschen
2014-02-06 14:13     ` Corinna Vinschen
2014-02-09 20:06   ` Marco Atzeri
2014-02-09 20:20     ` Corinna Vinschen
2014-02-10 16:14       ` Marco Atzeri

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