Re: [PATCH 2/7] builddefs: define linux

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



On 2/6/25 4:39 PM, Darrick J. Wong wrote:
> On Thu, Feb 06, 2025 at 03:19:57PM -0600, Eric Sandeen wrote:
>> There are several #ifdef linux guards in the code, but nothing
>> defined it. This caused several sparse warnings, so define it
>> when building on linux.
> 
> cpp in gcc 12.2 defines this:
> 
> $ touch /tmp/moo.h ; cpp -dM /tmp/moo.h | grep define.linux
> #define linux 1

Huh, on my test box too.
And yet without this sparse coughs up lots of things for me:

tlibio.c:90:20: error: undefined identifier 'LIO_IO_TYPES'
tlibio.c:90:33: error: undefined identifier 'LIO_WAIT_TYPES'
tlibio.c:92:20: error: undefined identifier 'LIO_IO_TYPES'
tlibio.c:92:33: error: undefined identifier 'LIO_WAIT_TYPES'
tlibio.c:118:20: error: undefined identifier 'LIO_IO_TYPES'
tlibio.c:118:33: error: undefined identifier 'LIO_WAIT_TYPES'

because i.e.:

#ifdef linux
#define LIO_IO_TYPES            00021   /* all io types */
#endif /* linux */

make V=1 shows:

/bin/sh ../libtool --quiet --tag=CC --mode=compile gcc -g -O2 -g -O2 -DDEBUG  -I../include -DVERSION=\"1.1.1\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall   -c tlibio.c

so not sure what's going on here ?


> --D
> 
>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
>> ---
>>  include/builddefs.in | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/builddefs.in b/include/builddefs.in
>> index 7274cde8..00dec0ea 100644
>> --- a/include/builddefs.in
>> +++ b/include/builddefs.in
>> @@ -78,7 +78,7 @@ HAVE_FICLONE = @have_ficlone@
>>  GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
>>  
>>  ifeq ($(PKG_PLATFORM),linux)
>> -PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
>> +PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux $(GCCFLAGS)
>>  endif
>>  ifeq ($(PKG_PLATFORM),darwin)
>>  PCFLAGS = -traditional-cpp $(GCCFLAGS)
>> -- 
>> 2.48.0
>>
>>
> 





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux