michal-josef-spacek / Alien-librpm

Find or download and install rpm library
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

error: conflicting types for 'fflush' #1

Open michal-josef-spacek opened 1 year ago

michal-josef-spacek commented 1 year ago

Issue in test of XS code with error: conflicting types for 'fflush'

michal-josef-spacek commented 1 year ago

full error:

# Failed test 'xs'
# at t/Alien-librpm/03-xs.t line 22.
#   ExtUtils::CBuilder->compile failed
#     error building /home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.o from '/home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.c' at /opt/perl-5.36.0t/lib/5.36.0/ExtUtils/CBuilder/Base.pm line 185.
#     cc -I/opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE -fPIC -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -o /home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.o /home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.c
#     In file included from /opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE/perl.h:3125,
#                      from /home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.xs:3:
#     /opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE/unixish.h:135:28: error: conflicting types for 'fflush'
#       135 | #define Fflush(fp)         fflush(fp)
#           |                            ^~~~~~
#     In file included from /opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE/perlio.h:41,
#                      from /opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE/iperlsys.h:50,
#                      from /opt/perl-5.36.0t/lib/5.36.0/x86_64-linux-thread-multi/CORE/perl.h:4110,
#                      from /home/cpansand/.cpan/build/2023062317/Alien-librpm-0.01-1/_alien/tmp/test-alien-xYoKzW/test.xs:3:
#     /usr/include/stdio.h:218:12: note: previous declaration of 'fflush' was here
#       218 | extern int fflush (FILE *__stream);
#           |            ^~~~~~
# Looks like you failed 1 test of 3.
t/Alien-librpm/03-xs.t ....... 
michal-josef-spacek commented 1 year ago

Provisional fix: https://github.com/michal-josef-spacek/Alien-librpm/commit/5d41c68d5b778c5dc6d307ca864f644d9efa7fc7