[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lzip-bug] Parameter is not bool (clzip)

From: Adam Tuja
Subject: Re: [Lzip-bug] Parameter is not bool (clzip)
Date: Tue, 08 Nov 2022 13:45:53 +0100

Note that 'in_statsp' is a pointer, and according to the C99 standard:

As you mentioned C99, out of curiosity I tried to compile it with -std=c99 and the result was, to say the least, surprising. I got bunch of serious warnings and an error.


$ gcc -std=c99 -Wall -W -O2 -DPROGVERSION=\"1.13\" -c -o main.o main.c

main.c: In function ‘open_instream’:

main.c:473:31: warning: implicit declaration of function ‘S_ISSOCK’ [-Wimplicit-function-declaration]

                               S_ISFIFO( mode ) || S_ISSOCK( mode ) ) );


main.c: In function ‘close_and_set_permissions’:

main.c:591:5: warning: implicit declaration of function ‘fchown’ [-Wimplicit-function-declaration]

     if( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) == 0 )


main.c:592:7: warning: implicit declaration of function ‘fchmod’ [-Wimplicit-function-declaration]

       { if( fchmod( outfd, mode ) != 0 ) warning = true; }


main.c:595:56: error: ‘S_ISVTX’ undeclared (first use in this function)

           fchmod( outfd, mode & ~( S_ISUID | S_ISGID | S_ISVTX ) ) != 0 )


main.c:595:56: note: each undeclared identifier is reported only once for each function it appears in


Even "resolving" that manually


$ gcc -std=c99 -Wall -W -O2 -DPROGVERSION=\"1.13\" -DS_ISVTX=01000 -c -o main.o main.c


didn't get me far as I got another error.


$ gcc -Wall -W -O2  -o clzip carg_parser.o lzip_index.o list.o encoder_base.o encoder.o fast_encoder.o decoder.o main.o

main.o: In function `open_instream':

main.c:(.text+0xaeb): undefined reference to `S_ISSOCK'


I realise it's general gcc question rather than lzip stuff.

I can only guess that some things are not included in a headers but I wonder how it works without `c99' standard.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]