Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-25 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>I loaded the gcc 2.95 compiler for the sole purpose of compiling CVS on
>this platform since previously CVS Home didn't offer a binary for this
>platform. I loaded the gcc 3.4 compiler for the sole purpose of fixing
>the CVS compile on this platform. I assume both versions can coexist
>with appropriate configuration. I turn the questions around:


Does what I just checked in work for you on Solaris?

>How can we use both versions to the CVS Project's advantage?
>Which version should be canonical for next binary release?


With luck, it doesn't matter now.

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFClNl3LD1OTBfyMaQRAuw0AKCNgFRpezLlLdiqkdB20fWAgTc+YwCeK08B
0w1T6Fqgvd+DX2ysEtKdNAQ=
=Zx0Q
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-25 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> >A gcc upgrade sure helps.  I installed gcc 3.4.2 binary from SunFreeWare.\
> 
> I brought up changes to the GNULIB stat module up on bug-gnulib and
> found out that this problem has been encountered before.  GNULIB is
> going to continue supporting the older gccs without the fix you found in
> 3.4.2, so I have updated the glob.c file to use struct_stat64 in place
> of struct stat, and #defined struct_stat64 to struct stat64 or struct
> stat as appropriate.  Does this work for you with whichever compiler you
> choose to stick with?

I'd like to suggest defining "struct_name" with a "typedef" instead of a
"#define" as the preprocessor is recursive and a "struct stat" macro value
will still be substituted by "#define stat ..." macro.

I loaded the gcc 2.95 compiler for the sole purpose of compiling CVS on
this platform since previously CVS Home didn't offer a binary for this
platform.  I loaded the gcc 3.4 compiler for the sole purpose of fixing
the CVS compile on this platform.  I assume both versions can coexist
with appropriate configuration.  I turn the questions around:

How can we use both versions to the CVS Project's advantage?
Which version should be canonical for next binary release?

> Regards,

Ditto,

> Derek

Conrad



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-25 Thread Derek Price
Conrad T. Pino wrote:

>Hi Derek,
>
>  
>
>>From: Conrad T. Pino
>>
>>
>>
>>>From: Derek Price
>>>
>>>Perhaps the problem is in your GCC installation or usage?
>>>  
>>>
>
>A gcc upgrade sure helps.  I installed gcc 3.4.2 binary from SunFreeWare.\
>  
>

I brought up changes to the GNULIB stat module up on bug-gnulib and
found out that this problem has been encountered before.  GNULIB is
going to continue supporting the older gccs without the fix you found in
3.4.2, so I have updated the glob.c file to use struct_stat64 in place
of struct stat, and #defined struct_stat64 to struct stat64 or struct
stat as appropriate.  Does this work for you with whichever compiler you
choose to stick with?

Regards,

Derek



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Conrad T. Pino
>
> > From: Derek Price
> >
> > Perhaps the problem is in your GCC installation or usage?

A gcc upgrade sure helps.  I installed gcc 3.4.2 binary from SunFreeWare.

Program test00 works as expected and results are below.
Program test01 compile files with #pragma ... error and results are below.
Program test02 works proving the #pragma ... works and results are below.

We have a clean "lib/glob.c" compile and sucessful build with the results below.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test00.c; rm test00; gcc -v; gcc -o 
test00 test00.c; ./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
Reading specs from 
/export/home/usr/local/bin/../lib/gcc/i386-pc-solaris2.8/3.4.2/specs
Configured with:
../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls 
--disable-libgcj --enable-languages=c,c+ :
(reconfigured)
../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls 
--disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2
__PRAGMA_REDEFINE_EXTNAME is defined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test01.c; rm test01; gcc -o test01 
test01.c fidofifo.c; ./test01
#include "fidofifi.h"

void test0( void )
{
printf( "test0 fido is %s\n", fido( ) );
printf( "test0 fifi is %s\n", fifi( ) );
}

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test0( );
test1( );

return 0;
}
gcc: fidofifo.c: No such file or directory
test01.c:9: warning: #pragma redefine_extname conflicts with declaration
test01.c:9: warning: fido renamed after being referenced in assembly
test01.c:9: internal compiler error: in change_decl_assembler_name, at 
cgraph.c:532
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html> for instructions.
ksh: ./test01:  not found
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test02.c; rm test02; gcc -o test02 
test02.c fidofifi.c; ./test02
#include "fidofifi.h"

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test1( );

return 0;
}
test02.c:3: warning: #pragma redefine_extname conflicts with declaration
test1 fido is fifi
test1 fifi is fifi
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ rm lib/glob.o
/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
if gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -MT glob.o -MD -MP 
-MF ".deps/glob.Tpo" -c -o glob.o glob.c; \
then mv -f ".deps/glob.Tpo" ".deps/glob.Po"; else rm -f ".deps/glob.Tpo"; exit 
1; fi
rm -f libcvs.a
ar cru libcvs.a sighandle.o allocsa.o  cycle-check.o basename.o stripslash.o  
getnline.o xalloc-die.o xgetcwd.o  xgethostname.o
xreadlink.o save-cwd.o lstat.o mktime.o strftime.o canonicalize.o chdir-long.o 
mempcpy.o openat.o memrchr.o closeout.o dirname.o
exitfail.o getcwd.o getdate.o getline.o getndelim2.o getopt.o getopt1.o 
getpass.o gettime.o md5.o pagealign_alloc.o path-concat.o
quotearg.o regex.o rpmatch.o setenv.o unsetenv.o dup-safer.o fd-safer.o 
vasnprintf.o printf-args.o printf-parse.o asnprintf.o
vasprintf.o asprintf.o xmalloc.o yesno.o glob.o
ranlib libcvs.a
Making all in zlib
Making all in diff
Making all in src
gcc  -g -O2  -Lno/lib -o cvs  add.o admin.o annotate.o  buffer.o checkin.o 
checkout.o  classify.o client.o commit.o  create_adm.o
cvsrc.o diff.o  edit.o entries.o error.o  exithandle.o expand_path.o fileattr.o 
 filesubr.o find_names.o hardlink.o  hash.o
history.o ignore.o  import.o lock.o log.o  log-buffer.o login.o logmsg.o  ls.o 
main.o mkmodules.o  modules.o ms-buffer.o myndbm.o
no_diff.o parseinfo.o patch.o  rcs.o rcscmds.o recurse.o  release.o remove.o 
repos.o  root.o rsh-client.o run.o  scramble.o server.o
socket-client.o  sta

RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> > Solaris Pragmas
> > ---
> >
> > For compatibility with the SunPRO compiler, the following pragma is
> > supported.
> >
> > `redefine_extname OLDNAME NEWNAME'
> > This pragma gives the C function OLDNAME the assembler label
> > NEWNAME. The pragma must appear before the function declaration.
> > This pragma is equivalent to the asm labels extension (*note Asm
> > Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> > if the pragma is available.
> 
> Perhaps the problem is in your GCC installation or usage?

This link is similar to what you've found:
http://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/Solaris-Pragmas.html#Solaris%20Pragmas

but this one is different and possibly later:
http://gcc.gnu.org/onlinedocs/gcc/Symbol_002dRenaming-Pragmas.html#Symbol_002dRenaming-Pragmas
which reads, "These pragmas are only available on platforms whose system 
headers need them."
and perhaps by implication the corresponding macros are there either.

This raises an interesting question.  By adding "__PRAGMA_REDEFINE_EXTNAME" to 
the
command line "sys/stat.h" did NOT "#define stat,fstat,lstat ..." since the 
issue is
CVS and Solaris are both attempting to #define the same tokens and don't 
compilers
quietly ignore #pragma statements they don't understand?

See the test program below which compiles and runs with no errors.  If we 
believe
the test program the redefine_extname pragma is just not implemented.  If so I'm
sorry as I sent us barking up the wrong tree.

> Regards,

Ditto,

> Derek

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test01.c fidofifi.?; rm test01; gcc -o 
test01 test01.c fidofifi.c; ./test01
=== test01.c follows ===
#include "fidofifi.h"

void test0( void )
{
printf( "test0 fido is %s\n", fido( ) );
printf( "test0 fifi is %s\n", fifi( ) );
}

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test0( );
test1( );

return 0;
}
=== fidofifi.c follows ===
#include "fidofifi.h"

char * fido( void ) { return "fido"; }
=== fidofifi.h follows ===
char * fifi( void ) { return "fifi"; }
#ifndef _FIDOFIFO_H
#define _FIDOFIFO_H 1

#include 

extern char * fido( void );
extern char * fifi( void );
#endif
=== test01 output ===
test0 fido is fido
test0 fifi is fifi
test1 fido is fido
test1 fifi is fifi
/export/home/cvsusr/ccvs/cvs-1.12:$   


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have the same behavior with gcc 2.95.3 on NetBSD 1.6.1 platform.

Conrad

/usr/home/conrad:$ cat test00.c; uname -a; gcc -v; gcc -o test00 test00.c; 
./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
NetBSD heron.skyline.pino.net 1.6.1 NetBSD 1.6.1 (PinoFICdev) #0: Fri May 13 
02:26:01 PDT 2005
[EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/PinoFICdev i386
Using builtin specs.
gcc version 2.95.3 20010315 (release) (NetBSD nb3)
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/usr/home/conrad:$



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have the same behavior with gcc 3.3.5 on Debian Linux 2.6.8-2-686 platform.

Conrad

[EMAIL PROTECTED]:~$ cat test00.c; uname -a; gcc -v; gcc -o test00 test00.c; 
./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
Linux debzfp 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 GNU/Linux
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with:
../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang 
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/
share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--enable-__cxa_atexit --with-system-zlib --enable-nls --witho
ut-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm 
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-12)
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
[EMAIL PROTECTED]:~$



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> (For those new to this thread, this is because the Solaris headers
> #define stat stat64 when the __PRAGMA_REDEFINE_EXTNAME macro is not
> defined).
> 
> Why isn't gcc defining this value?  According to what I could find on
> the web, the compiler should define "__PRAGMA_REDEFINE_EXTNAME" if it
> supports the redefine_extname pragma, which this compiler apparently does.
> 
> .

That compiler costs money.  I'm using gcc distribution supplied on the
free software CD distrubuted with Solaris i.e. the 2.95.2 version.

> Why haven't we seen this error before?  Is this a common problem on
> Solaris 10?  Is this problem true of any gcc on any Solaris?  Is it
> specific to your setup?  What happens if you use a native Soalris compiler?

Because we've never "#define stat ..." and "#define lstat ..." before.

I haven't tried another gcc version.  Must I and must it be on Solaris?

I don't know if it's specific to this setup.  What should I test?

A native Solaris compiler costs money and I don't have one.

> A quick google search on "__PRAGMA_REDEFINE_EXTNAME Solaris 10 gcc"
> brings up a few discussions of this.  The gist of the first few I read
> is that some people ocassionally end up with broken GCCs which do not
> properly define this macro, but most GCCs should.  The reason for the
> difference was not apparent in the first several pages I scanned.

This looks promising even though I have Solaris 8 Intel Edition.

> Digging a little deeper, this is even documented in the Linux info
> manual for gcc:
> 
> > Solaris Pragmas
> > ---
> >
> > For compatibility with the SunPRO compiler, the following pragma is
> > supported.
> >
> > `redefine_extname OLDNAME NEWNAME'
> > This pragma gives the C function OLDNAME the assembler label
> > NEWNAME. The pragma must appear before the function declaration.
> > This pragma is equivalent to the asm labels extension (*note Asm
> > Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> > if the pragma is available.
> 
> 
> Perhaps the problem is in your GCC installation or usage?

/export/home/cvsusr/ccvs/cvs-1.12/windows-NT:$ gcc -v
Reading specs from /opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)

Isn't "usage" controlled by CVS make process or did I misunderstand?

I choose a broken gcc as the likely culprit. I'll run a test and report.

> Regards,

Ditto,

> Derek

Conrad



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Conrad T. Pino [mailto:[EMAIL PROTECTED]
> I choose a broken gcc as the likely culprit. I'll run a test and report.

Test program and results are below.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test00.c; gcc -o test00 test00.c; test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Defining macro "__PRAGMA_REDEFINE_EXTNAME" on the command line stops all
errors
>and warnings in "lib/glob.c" compile.


(For those new to this thread, this is because the Solaris headers
#define stat stat64 when the __PRAGMA_REDEFINE_EXTNAME macro is not
defined).

Why isn't gcc defining this value?  According to what I could find on
the web, the compiler should define "__PRAGMA_REDEFINE_EXTNAME" if it
supports the redefine_extname pragma, which this compiler apparently does.

.

Why haven't we seen this error before?  Is this a common problem on
Solaris 10?  Is this problem true of any gcc on any Solaris?  Is it
specific to your setup?  What happens if you use a native Soalris compiler?

A quick google search on "__PRAGMA_REDEFINE_EXTNAME Solaris 10 gcc"
brings up a few discussions of this.  The gist of the first few I read
is that some people ocassionally end up with broken GCCs which do not
properly define this macro, but most GCCs should.  The reason for the
difference was not apparent in the first several pages I scanned.

Digging a little deeper, this is even documented in the Linux info
manual for gcc:

> Solaris Pragmas
> ---
>
> For compatibility with the SunPRO compiler, the following pragma is
> supported.
>
> `redefine_extname OLDNAME NEWNAME'
> This pragma gives the C function OLDNAME the assembler label
> NEWNAME. The pragma must appear before the function declaration.
> This pragma is equivalent to the asm labels extension (*note Asm
> Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> if the pragma is available.


Perhaps the problem is in your GCC installation or usage?

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk+etLD1OTBfyMaQRAs9VAJ9KrtbzdH5ikvAiviVanqIfsSQOZwCglN4c
RbnHOR4yXu7wBbG9E9s5P4U=
=78Ar
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> >
> >I committed an inclusion immediately before "struct stat" forward
> >declaration to assure the Solaris "stat" macro is used but on 2nd
> >reflection the forward declaration is moot.  I'm considering it's
> >removal.  Any objection on your part?
> 
> No objections here.  Please do so.  Also, please shorten this comment to
> something like "get struct stat":
> 
> /* Solaris may "#define stat stat64" in some cases */

Done.

We have a new warning in "lib/glob.c" compile:

In file included from glob.h:100,
 from glob.c:23:
/usr/include/sys/stat.h:175: warning: `lstat' redefined
../config.h:1135: warning: this is the location of the previous 
definition

and prior "storage size of `st' isn't known" are still true.

Defining macro "__PRAGMA_REDEFINE_EXTNAME" on the command line stops all errors
and warnings in "lib/glob.c" compile.

> Thanks,

You're welcome,

> Derek

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
source='glob.c' object='glob.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/bash ../build-aux/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
In file included from glob.h:100,
 from glob.c:23:
/usr/include/sys/stat.h:175: warning: `lstat' redefined
../config.h:1135: warning: this is the location of the previous definition
glob.c: In function `rpl_glob':
glob.c:700: storage size of `st' isn't known
glob.c: In function `is_dir_p':
glob.c:1046: storage size of `st' isn't known
glob.c: In function `glob_in_dir':
glob.c:1094: storage size of `st' isn't known
*** Error code 1
make: Fatal error: Command failed for target `glob.o'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
Conrad T. Pino wrote:

>Hi Derek,
>
>  
>
>>From: Derek Price
>>
>>
>>
>>>1. #include  within glob_.h file.
>>>  
>>>
>>This would be the way to go.  You may commit this if you wish.
>>
>>
>
>I committed an inclusion immediately before "struct stat" forward
>declaration to assure the Solaris "stat" macro is used but on 2nd
>reflection the forward declaration is moot.  I'm considering it's
>removal.  Any objection on your part?
>  
>

No objections here.  Please do so.  Also, please shorten this comment to
something like "get struct stat":

/* Solaris may "#define stat stat64" in some cases */

Thanks,

Derek



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> It looks like your header is using some sort of #pragma to redefine the
> function names, which I would hope would make them look less like macros
> and actually remap the functions, allowing us to use the macros in
> glob.c as they stand.

The header file contains "#pragma redefine_extname ..." but they're not in
use because macro "__PRAGMA_REDEFINE_EXTNAME" is not defined.

A test compile with "__PRAGMA_REDEFINE_EXTNAME" defined on the command line
completes with no errors and no warnings.

> You are still encountering this problem with the latest glob.c?  We were
> encountering problems using the *64 structs and functions on HP-UX and I
> rewrote the file this morning to attempt to let compiler magic take care
> of the 64 bit conversion, which is supposed to work transparently on all
> systems.

Yes.

I updated before starting this morning.  I update as CVS commit messages
are noticed when downloading my email.

> Regards,

Ditto,

> Derek

Conrad



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

This platform's "sys/stat.h" implementation in this case
defines macros for "stat", "fstat" and "lstat" to be the
tokens "stat64", "fstat64" and "lstat64" respectively.
My analysis of "sys/stat.h" relevent section is below.

These macro definitions are in effect when "struct stat"
definition is encountered which becomes "struct stat64".

Line 187 of "lib/glob.c" redefines "stat64" as:

# define stat64 stat

which causes later "struct stat" references to be become
"struct stat64" which becomes "struct stat" which is an
empty forward declaration at best.

It seems defining macros for "stat", "fstat", "lstat",
"stat64", "fstat64" and "lstat64" on this platform is
a risky proposition.

Conrad

/*
 * large file compilation environment setup
 */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
// This is true #error Die
#ifdef  __PRAGMA_REDEFINE_EXTNAME
// This is false #error Die
#pragma redefine_extnamefstat   fstat64
#pragma redefine_extnamestatstat64

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2) || defined(__EXTENSIONS__)
// This is false #error Die
#pragma redefine_extnamelstat   lstat64
#endif
#else   /* __PRAGMA_REDEFINE_EXTNAME */
// This is true #error Die
#define fstat   fstat64
#define statstat64
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2) || defined(__EXTENSIONS__)
// This is true #error Die
#define lstat   lstat64
#endif
#endif  /* __PRAGMA_REDEFINE_EXTNAME */
#endif  /* !_LP64 && _FILE_OFFSET_BITS == 64 */



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It looks like your header is using some sort of #pragma to redefine the
function names, which I would hope would make them look less like macros
and actually remap the functions, allowing us to use the macros in
glob.c as they stand.

You are still encountering this problem with the latest glob.c?  We were
encountering problems using the *64 structs and functions on HP-UX and I
rewrote the file this morning to attempt to let compiler magic take care
of the 64 bit conversion, which is supposed to work transparently on all
systems.

Regards,

Derek


Conrad T. Pino wrote:

>Hi Derek,
>
>This platform's "sys/stat.h" implementation in this case
>defines macros for "stat", "fstat" and "lstat" to be the
>tokens "stat64", "fstat64" and "lstat64" respectively.
>My analysis of "sys/stat.h" relevent section is below.
>
>These macro definitions are in effect when "struct stat"
>definition is encountered which becomes "struct stat64".
>
>Line 187 of "lib/glob.c" redefines "stat64" as:
>
> # define stat64 stat
>
>which causes later "struct stat" references to be become
>"struct stat64" which becomes "struct stat" which is an
>empty forward declaration at best.
>
>It seems defining macros for "stat", "fstat", "lstat",
>"stat64", "fstat64" and "lstat64" on this platform is
>a risky proposition.
>
>Conrad
>
>/*
> * large file compilation environment setup
> */
>#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
>// This is true #error Die
>#ifdef __PRAGMA_REDEFINE_EXTNAME
>// This is false #error Die
>#pragma redefine_extname fstat fstat64
>#pragma redefine_extname stat stat64
>
>#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
> defined(_XPG4_2) || defined(__EXTENSIONS__)
>// This is false #error Die
>#pragma redefine_extname lstat lstat64
>#endif
>#else /* __PRAGMA_REDEFINE_EXTNAME */
>// This is true #error Die
>#define fstat fstat64
>#define stat stat64
>#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
> defined(_XPG4_2) || defined(__EXTENSIONS__)
>// This is true #error Die
>#define lstat lstat64
>#endif
>#endif /* __PRAGMA_REDEFINE_EXTNAME */
>#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
>

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk5rLLD1OTBfyMaQRAhbVAJ4weUVLak0/PGsMQUPYxK+mVgy91gCeMJSV
Z/A53LJrStIsU8S9irOFLlY=
=MgP1
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> >1. #include  within glob_.h file.
> 
> This would be the way to go.  You may commit this if you wish.

I committed an inclusion immediately before "struct stat" forward
declaration to assure the Solaris "stat" macro is used but on 2nd
reflection the forward declaration is moot.  I'm considering it's
removal.  Any objection on your part?

> >2. Move #include  below #include  in glob.c file.
> 
> This is incorrect.  The GNULIB convention is to include a module's
> header immediately following the include of  in its associated
> source file (i.e. glob.c first including config.h then immediately
> including glob.h) to test the module's interface.

Thank you.

> Regards,

Ditto,

> Derek

Conrad


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> Adding "#include " to glob_.h doesn't help with this new
> error?  ...

That is correct.  

Neither of (1) uncondition inclusion nor (2) inclusion conditioned upon
"__USE_GNU" made a difference.

> ...  I wouldn't expect this error in glob.c anyhow, since it includes
>  &  unconditionally.  According to POSIX.2,
> struct stat should be defined in .  This same code, short of
> a few recent changes, was compiling and passing tests on Solaris 8 the
> other night.

This platform's "sys/stat.h" uses a *lot* of conditional compilation and
we may have triggered a case where no "struct stat" definition compiles.
I haven't proved this yet and testing this hypothesis is my next line of
investigation unless you favor another.

Can you take a quick look at this platform's "sys/stat.h" (below) to see
if there's something obvious to your greater experience?

> Regards,

Ditto,

> Derek

Conrad

/export/home/cvsusr:$ cat /usr/include/sys/stat.h
/*
 * Copyright (c) 1995-1999 by Sun Microsystems, Inc.
 * All rights reserved.
 */

/*  Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/*  Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
/*  All Rights Reserved */

/*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF  */
/*  UNIX System Laboratories, Inc.  */
/*  The copyright notice above does not evidence any*/
/*  actual or intended publication of such source code. */

#ifndef _SYS_STAT_H
#define _SYS_STAT_H

#pragma ident   "@(#)stat.h 1.2 99/05/19 SMI"

#include 
#include 

#ifdef  __cplusplus
extern "C" {
#endif

/*
 * The implementation specific header  includes a
 * definition for timestruc_t needed by the stat structure.  However,
 * including either , which includes , or
 * including  directly will break both X/Open and
 * POSIX namespace. Preceeding tag, structure, and structure member
 * names with underscores eliminates the namespace breakage and at the
 * same time, with unique type names, eliminates the possibility of
 * timespec_t or timestruct_t naming conflicts that could otherwise
 * result based on the order of inclusion of  and
 * .  The header  contains the
 * standards namespace safe versions of these definitions.
 */
#if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || \
defined(__EXTENSIONS__)
#include 
#else
#include 
#endif /* !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || ... */

#define _ST_FSTYPSZ 16  /* array size for file system type name */

/*
 * stat structure, used by stat(2) and fstat(2)
 */

#if defined(_KERNEL)

/* Old SVID stat struct (SVR3.x) */

struct  o_stat {
o_dev_t st_dev;
o_ino_t st_ino;
o_mode_tst_mode;
o_nlink_t   st_nlink;
o_uid_t st_uid;
o_gid_t st_gid;
o_dev_t st_rdev;
off32_t st_size;
time32_tst_atime;
time32_tst_mtime;
time32_tst_ctime;
};

/* Expanded stat structure */

#if defined(_LP64)

struct stat {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

struct stat64 {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

#else   /* _LP64 */

struct  stat {
dev_t   st_dev;
longst_pad1[3]; /* reserve for dev expansion, */
/* sysid definition */
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
longst_pad2[2];
off_t   st_size;
longst_pad3;/* pad for future off_t expansion */
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
longst_pad4[8]; /* expansion area */
};

struct  stat64 {

Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Hi Derek,
>
>We have a new "lib/glob.c" error today which I hope to
>understand before committing "#include "
>addition to "lib/glob_.h" you suggested.


Adding "#include " to glob_.h doesn't help with this new
error?  I wouldn't expect this error in glob.c anyhow, since it includes
 &  unconditionally.  According to POSIX.2,
struct stat should be defined in .  This same code, short of
a few recent changes, was compiling and passing tests on Solaris 8 the
other night.

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk3f2LD1OTBfyMaQRAtuHAJ98+uXWGRexlVslLWvfCE1+yCbMQQCgqvo6
JgiejX7f4tv94fJ5EEAz1Rk=
=9D5+
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have a new "lib/glob.c" error today which I hope to
understand before committing "#include "
addition to "lib/glob_.h" you suggested.

The 3 new errors (see below) are all a single error
occurring in 3 places:

storage size of `st' isn't known

I'm throwing this out for comment while continuing
to investigate.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
source='glob.c' object='glob.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/bash ../build-aux/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
glob.c: In function `rpl_glob':
glob.c:700: storage size of `st' isn't known
glob.c: In function `is_dir_p':
glob.c:1046: storage size of `st' isn't known
glob.c: In function `glob_in_dir':
glob.c:1094: storage size of `st' isn't known
*** Error code 1
make: Fatal error: Command failed for target `glob.o'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-21 Thread Derek Price
Conrad T. Pino wrote:

>1. #include  within glob_.h file.
>  
>

This would be the way to go.  You may commit this if you wish.

>2. Move #include  below #include  in glob.c file.
>  
>

This is incorrect.  The GNULIB convention is to include a module's
header immediately following the include of  in its associated
source file (i.e. glob.c first including config.h then immediately
including glob.h) to test the module's interface.

Regards,

Derek



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-21 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Excuse me for perhaps being slow but why is configure choosing to
>use "lib/glob.h" when the platform has "/usr/include/glob.h" whose
>contents follow?


Partly because the GNU glob semantics are more extensive than the POSIX
spec, partly because Mark Baushke reported that even glob functions that
are supposed to meet the POSIX spec often don't, the new glob module
only uses a system glob when it appears to be GNU glob.  I can't tell
for sure without reviewing your configure.log, but the specific reason
configure noticed that your glob.h doesn't work is probably the lack of
a  defining the _GNU_GLOB_INTERFACE_VERSION macro.

Cheers,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCj7VRLD1OTBfyMaQRAjPjAKDIQrjsR+KcEDO+I1s5VvDLoq1uKgCg6zB2
TbTb97b7MY0vBc5ksWkTY6U=
=FvX6
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-20 Thread Conrad T. Pino
Excuse me for perhaps being slow but why is configure choosing to
use "lib/glob.h" when the platform has "/usr/include/glob.h" whose
contents follow?

/usr/include:$ cat glob.h
/*
 * Copyright (c) 1994 by Sun Microsystems, Inc.
 * Copyright 1985, 1992 by Mortice Kern Systems Inc.  All rights reserved.
 */

#ifndef _GLOB_H
#define _GLOB_H

#pragma ident   "@(#)glob.h 1.4 95/03/08 SMI"

#include 

#ifdef  __cplusplus
extern "C" {
#endif

typedef struct  glob_t  {
size_t  gl_pathc;   /* Count of paths matched by pattern */
char**gl_pathv; /* List of matched pathnames */
size_t  gl_offs;/* # of slots reserved in gl_pathv */
/* following are internal to the implementation */
char**gl_pathp; /* gl_pathv + gl_offs */
int gl_pathn;   /* # of elements allocated */
}   glob_t;

/*
 * "flags" argument to glob function.
 */
#define GLOB_ERR0x0001  /* Don't continue on directory error */
#define GLOB_MARK   0x0002  /* Mark directories with trailing / */
#define GLOB_NOSORT 0x0004  /* Don't sort pathnames */
#define GLOB_NOCHECK0x0008  /* Return unquoted arg if no match */
#define GLOB_DOOFFS 0x0010  /* Ignore gl_offs unless set */
#define GLOB_APPEND 0x0020  /* Append to previous glob_t */
#define GLOB_NOESCAPE   0x0040  /* Backslashes do not quote M-chars */

/*
 * Error returns from "glob"
 */
#define GLOB_NOSYS  (-4)/* function not supported (XPG4) */
#define GLOB_NOMATCH(-3)/* Pattern does not match */
#define GLOB_NOSPACE(-2)/* Not enough memory */
#define GLOB_ABORTED(-1)/* GLOB_ERR set or errfunc return!=0 */

#if defined(__STDC__)
extern int glob(const char *, int, int(*)(const char *, int), glob_t *);
extern void globfree(glob_t *);
#else
extern int glob();
extern void globfree();
#endif

#ifdef  __cplusplus
}
#endif

#endif  /* _GLOB_H */
/usr/include:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-20 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> This should be irrelevant, since all reference to "struct stat" should
> be made using the Solaris definition.  Our code never attempts to define
> it and I am fairly certain that the "struct stat;" line in glob_.h only
> declares the existance of said structure.

[snip]  See below.

> I am more suspicious of the __restrict keyword.  "restrict" should not
> cause this sort of warning by my understanding of the C99 spec, but is
> it possible that this is doing something we don't understand on
> Solaris?  Here's the prototype of those function calls:
> 
> #ifdef __USE_GNU
> int (*gl_lstat) (__const char *__restrict, struct stat *__restrict);
> int (*gl_stat) (__const char *__restrict, struct stat *__restrict);
> #else
> int (*gl_lstat) (__const char *__restrict, void *__restrict);
> int (*gl_stat) (__const char *__restrict, void *__restrict);
> #endif
> 
> So, I am guessing that the problem is here.  ST is definitately a
> "struct stat" in all three of the calls your compiler is warning about. 
> We should also be able to assume __USE_GNU is set by the line at the
> beginning of glob_.h.  Even if this wasn't so, by C89 any pointer type
> should be castable to void *, so the problem should still be with the
> restrict keyword.

No amount of playing with "__restrict" made any difference.  I removed it
completely and the warning was identical.

Either this platform's "struct stat" implementation or the compiler's
interpretation of same are incompatible with a "struct stat;" forward
declaration.

The only way I could eliminate the warnings was to either:

1. #include  within glob_.h file.

2. Move #include  below #include  in glob.c file.

The patch below implements the latter.  I'll commit it if you approve.

Ditto,

> Regards,

Ditto,

> Derek

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cvs diff -Nup lib/glob.c
Index: lib/glob.c
===
RCS file: /cvs/ccvs/lib/glob.c,v
retrieving revision 1.11
diff -u -p -r1.11 glob.c
--- lib/glob.c  20 May 2005 18:39:47 -  1.11
+++ lib/glob.c  21 May 2005 00:48:05 -
@@ -20,13 +20,13 @@
 # include 
 #endif
 
-#include 
-
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 /* Outcomment the following line for production quality code.  */
 /* #define NDEBUG 1 */
 #include 



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-20 Thread Derek Price
Conrad T. Pino wrote:

>>From: Derek Price [mailto:[EMAIL PROTECTED]
>>
>>I think I just checked in fixes for both Solaris compile problems, this
>>one and one with getpwnam_r.  Could you let me know if they work?  I
>>have no way to test here.
>>
>>
>
>The compile completes but we have warnings (see below).  Problem may
>be "struct stat" definition and I've include this platform's definition.
>  
>

This should be irrelevant, since all reference to "struct stat" should
be made using the Solaris definition.  Our code never attempts to define
it and I am fairly certain that the "struct stat;" line in glob_.h only
declares the existance of said structure.

> 719: ? ((*pglob->gl_stat) (dirname, &st) == 0
>1066:? (*pglob->gl_stat) (fullname, &st) == 0 && S_ISDIR (st.st_mode)
>1116: ? (*pglob->gl_stat) (fullname, &st)
>
>gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
>glob.c: In function `rpl_glob':
>glob.c:719: warning: passing arg 2 of pointer to function from incompatible 
>pointer type
>glob.c: In function `is_dir_p':
>glob.c:1066: warning: passing arg 2 of pointer to function from incompatible 
>pointer type
>glob.c: In function `glob_in_dir':
>glob.c:1116: warning: passing arg 2 of pointer to function from incompatible 
>pointer type
>  
>

I am more suspicious of the __restrict keyword.  "restrict" should not
cause this sort of warning by my understanding of the C99 spec, but is
it possible that this is doing something we don't understand on
Solaris?  Here's the prototype of those function calls:

#ifdef __USE_GNU
int (*gl_lstat) (__const char *__restrict, struct stat *__restrict);
int (*gl_stat) (__const char *__restrict, struct stat *__restrict);
#else
int (*gl_lstat) (__const char *__restrict, void *__restrict);
int (*gl_stat) (__const char *__restrict, void *__restrict);
#endif

So, I am guessing that the problem is here.  ST is definitately a
"struct stat" in all three of the calls your compiler is warning about. 
We should also be able to assume __USE_GNU is set by the line at the
beginning of glob_.h.  Even if this wasn't so, by C89 any pointer type
should be castable to void *, so the problem should still be with the
restrict keyword.

Regards,

Derek



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-19 Thread Conrad T. Pino
> From: Derek Price [mailto:[EMAIL PROTECTED]
>
> I think I just checked in fixes for both Solaris compile problems, this
> one and one with getpwnam_r.  Could you let me know if they work?  I
> have no way to test here.

The compile completes but we have warnings (see below).  Problem may
be "struct stat" definition and I've include this platform's definition.

> Regards,

Ditto,

> Derek

Conrad

 719:  ? ((*pglob->gl_stat) (dirname, &st) == 0
1066: ? (*pglob->gl_stat) (fullname, &st) == 0 && S_ISDIR (st.st_mode)
1116:  ? (*pglob->gl_stat) (fullname, &st)

gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
glob.c: In function `rpl_glob':
glob.c:719: warning: passing arg 2 of pointer to function from incompatible 
pointer type
glob.c: In function `is_dir_p':
glob.c:1066: warning: passing arg 2 of pointer to function from incompatible 
pointer type
glob.c: In function `glob_in_dir':
glob.c:1116: warning: passing arg 2 of pointer to function from incompatible 
pointer type
rm -f libcvs.a
ar cru libcvs.a sighandle.o allocsa.o  basename.o stripslash.o getnline.o  
xalloc-die.o xgetcwd.o xgethostname.o  xreadlink.o
save-cwd.o lstat.o mktime.o strftime.o chdir-long.o mempcpy.o openat.o 
memrchr.o closeout.o dirname.o exitfail.o getcwd.o getdate.o
getline.o getndelim2.o getopt.o getopt1.o getpass.o gettime.o md5.o 
pagealign_alloc.o quotearg.o regex.o rpmatch.o setenv.o
unsetenv.o dup-safer.o fd-safer.o vasnprintf.o printf-args.o printf-parse.o 
asnprintf.o vasprintf.o asprintf.o xmalloc.o yesno.o
glob.o
ranlib libcvs.a

=== /usr/include/sys/stat.h follows ===
/usr/include:$ cat sys/stat.h
/*
 * Copyright (c) 1995-1999 by Sun Microsystems, Inc.
 * All rights reserved.
 */

/*  Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/*  Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
/*  All Rights Reserved */

/*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF  */
/*  UNIX System Laboratories, Inc.  */
/*  The copyright notice above does not evidence any*/
/*  actual or intended publication of such source code. */

#ifndef _SYS_STAT_H
#define _SYS_STAT_H

#pragma ident   "@(#)stat.h 1.2 99/05/19 SMI"

#include 
#include 

#ifdef  __cplusplus
extern "C" {
#endif

/*
 * The implementation specific header  includes a
 * definition for timestruc_t needed by the stat structure.  However,
 * including either , which includes , or
 * including  directly will break both X/Open and
 * POSIX namespace. Preceeding tag, structure, and structure member
 * names with underscores eliminates the namespace breakage and at the
 * same time, with unique type names, eliminates the possibility of
 * timespec_t or timestruct_t naming conflicts that could otherwise
 * result based on the order of inclusion of  and
 * .  The header  contains the
 * standards namespace safe versions of these definitions.
 */
#if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || \
defined(__EXTENSIONS__)
#include 
#else
#include 
#endif /* !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || ... */

#define _ST_FSTYPSZ 16  /* array size for file system type name */

/*
 * stat structure, used by stat(2) and fstat(2)
 */

#if defined(_KERNEL)

/* Old SVID stat struct (SVR3.x) */

struct  o_stat {
o_dev_t st_dev;
o_ino_t st_ino;
o_mode_tst_mode;
o_nlink_t   st_nlink;
o_uid_t st_uid;
o_gid_t st_gid;
o_dev_t st_rdev;
off32_t st_size;
time32_tst_atime;
time32_tst_mtime;
time32_tst_ctime;
};

/* Expanded stat structure */

#if defined(_LP64)

struct stat {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

struct stat64 {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

#else   /* _LP64 */

struct  stat {
dev_t   st_dev;
longst_pad1[3]; /* reserve for dev expansion, */
   

RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-19 Thread Conrad T. Pino
We have an improvement after a recent commit.  An old errors was fixed
but a new errors was uncovered:

gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
glob.c: In function `rpl_glob':
glob.c:579: too many arguments to function `getpwnam_r'
glob.c:660: too many arguments to function `getpwnam_r'
glob.c:714: warning: passing arg 2 of pointer to function from incompatible 
pointer type
glob.c: In function `is_dir_p':
glob.c:1061: warning: passing arg 2 of pointer to function from incompatible 
pointer type
glob.c: In function `glob_in_dir':
glob.c:: warning: passing arg 2 of pointer to function from incompatible 
pointer type
*** Error code 1
make: Fatal error: Command failed for target `glob.o'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
/export/home/cvsusr/ccvs/cvs-1.12:$ 

=== /usr/include/pwd.h content follows =
/usr/include:$ cat pwd.h
/*  Copyright (c) 1988 AT&T */
/*All Rights Reserved   */

/*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/*  The copyright notice above does not evidence any*/
/*  actual or intended publication of such source code. */

/*
 * Copyright (c) 1996, by Sun Microsystems, Inc.
 * All rights reserved.
 */

#ifndef _PWD_H
#define _PWD_H

#pragma ident   "@(#)pwd.h  1.1996/03/12 SMI"   /* SVr4.0 1.3.1.9 */

#include 

#include 

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
#include 
#endif

#ifdef  __cplusplus
extern "C" {
#endif

struct passwd {
char*pw_name;
char*pw_passwd;
uid_t   pw_uid;
gid_t   pw_gid;
char*pw_age;
char*pw_comment;
char*pw_gecos;
char*pw_dir;
char*pw_shell;
};

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
struct comment {
char*c_dept;
char*c_name;
char*c_acct;
char*c_bin;
};
#endif /* defined(__EXTENSIONS__) || (!defined(_POSIX_C_SOURCE) && ... */

#if defined(__STDC__)

extern struct passwd *getpwuid(uid_t);  /* MT-unsafe */
extern struct passwd *getpwnam(const char *);   /* MT-unsafe */

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
extern struct passwd *getpwent_r(struct passwd *, char *, int);
extern struct passwd *fgetpwent_r(FILE *, struct passwd *, char *, int);
extern struct passwd *fgetpwent(FILE *);/* MT-unsafe */
extern int putpwent(const struct passwd *, FILE *);
#endif /* defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) ... */

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2)
extern void endpwent(void);
extern struct passwd *getpwent(void);   /* MT-unsafe */
extern void setpwent(void);
#endif /* defined(__EXTENSIONS__) || (!defined(_POSIX_C_SOURCE) && ... */

#else  /* (__STDC__) */

extern struct passwd *getpwuid();   /* MT-unsafe */
extern struct passwd *getpwnam();   /* MT-unsafe */

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
extern struct passwd *getpwent_r();
extern struct passwd *fgetpwent_r();

extern struct passwd *fgetpwent();  /* MT-unsafe */
extern int putpwent();
#endif /* defined(__EXTENSIONS__) || (!defined(_POSIX_C_SOURCE) && ... */

#if defined(__EXTENSIONS__) || \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2)
extern void endpwent();
extern struct passwd *getpwent();   /* MT-unsafe */
extern void setpwent();
#endif /* defined(__EXTENSIONS__) || (!defined(_POSIX_C_SOURCE) && ... */

#endif /* (__STDC__) */

/*
 * getpwuid_r() & getpwnam_r() prototypes are defined here.
 */

/*
 * Previous releases of Solaris, starting at 2.3, provided definitions of
 * various functions as specified in POSIX.1c, Draft 6.  For some of these
 * functions, the final POSIX 1003.1c standard had a different number of
 * arguments and return values.
 *
 * The following segment of this header provides support for the standard
 * interfaces while supporting applications written under earlier
 * releases.  The application defines appropriate values of the feature
 * test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate
 * whether it was written to expect the Draft 6 or standard versions of
 * these interfaces, before including this header.  This header then
 * provides a mapping from the source version of the interface to an
 * appropriate binary interf

Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-19 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>The Solaris function declaration from
>
> /usr/include/unistd.h:850: previous declaration of `getlogin_r'
>
>looks like:
>
> extern char *getlogin_r(char *, int);
>
>and "lib/glob.c" line 194 looks like:
>
> extern int getlogin_r (char *, size_t);


I think I just checked in fixes for both Solaris compile problems, this
one and one with getpwnam_r.  Could you let me know if they work?  I
have no way to test here.

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCjSJNLD1OTBfyMaQRAu1zAKCQHUN7hUIRF3cg8ifF5SZhhMYCVgCgqVVM
qHJtNR8Jvse2ww0zgw/MR5s=
=H0VL
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-19 Thread Conrad T. Pino
The Solaris function declaration from

/usr/include/unistd.h:850: previous declaration of `getlogin_r'

looks like:

extern char *getlogin_r(char *, int);

and "lib/glob.c" line 194 looks like:

extern int getlogin_r (char *, size_t);

after checking with a test program "size_t" and "int" are both 4 bytes
on this platform.  The "size_t" type is "unsigned long" so I assume
"long" and "int" are equivialent.  Testing details follow:

Here's what I know about "size_t" and "int" based on this program:

#include 
#include 

int main( int argc, char *argv[ ] )
{
printf( "sizeof (int) = %u\n", sizeof (int) );
printf( "sizeof (size_t) = %u\n", sizeof (size_t) );
return 0;
}

/export/home/cvsusr:$ gcc main.c
/export/home/cvsusr:$ a.out
sizeof (int) = 4
sizeof (size_t) = 4

adding these lines before "main" function:

extern fido( int );
extern fido( size_t );

gives this error:

/export/home/cvsusr:$ gcc main.c
main.c:5: conflicting types for `fido'
main.c:4: previous declaration of `fido'

and the gcc version is:

/export/home/cvsusr:$ gcc -v
Reading specs from /opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs