Buiiding LO6.1.4.2 with pdfium emits “error: invalid conversion from ‘int’ to ‘boolean’ [-fpermissive]”

Дилян Палаузов dpa-libreoffice at aegee.org
Thu Jan 17 09:35:30 UTC 2019


Hello,

the problematic call is:

S=/src/libreoffice-6.1.4.2 && B=$S/build && I=$B/instdir && W=$B/workdir &&  mkdir -p
$W/GenCxxObject/UnpackedTarball/pdfium/core/fxcodec/codec/
$W/Dep/GenCxxObject/UnpackedTarball/pdfium/core/fxcodec/codec/ && cd /src/libreoffice-6.1.4.2 &&    g++
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=gcc3 -DLINUX -DNDEBUG -DOSL_DEBUG_LEVEL=0 -DUNIX
-DUNX -DX86_64 -D_PTHREADS -D_REENTRANT -DPDFIUM_DLLIMPLEMENTATION -DUSE_SYSTEM_LCMS2 -DUSE_SYSTEM_LIBJPEG
-DUSE_SYSTEM_ZLIB -DMEMORY_TOOL_REPLACES_ALLOCATOR -DUNICODE  -DSYSTEM_ZLIB  -DDEFINE_PS_TABLES_DATA   -
fvisibility=hidden    -Wall -Wno-missing-braces -Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunreachable-code
-Wunused-macros -finput-charset=UTF-8 -fmessage-length=0 -fno-common -pipe  -Wduplicated-cond -Wlogical-op -Wshift-
overflow=2 -Wunused-const-variable=1 -Wno-cast-function-type -fvisibility-inlines-hidden -fstack-protector-strong -fPIC
-Wshadow -Woverloaded-virtual -std=gnu++14   -DEXCEPTIONS_ON -fexceptions -fno-enforce-eh-specs -O3 -pipe   -w  -
DLIBO_INTERNAL_ONLY  -c $W/UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec_jpeg.cpp -o
$W/GenCxxObject/UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec_jpeg.o -MMD -MT
$W/GenCxxObject/UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec_jpeg.o -MP -MF
$W/Dep/GenCxxObject/UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec_jpeg.d_ -I$W/UnpackedTarball/pdfium
-I$W/UnpackedTarball/pdfium/third_party -I$S/include  -I/opt/jdk/include -I/opt/jdk/include/linux -I$B/config_host    -
isystem /usr/local/include -Wno-long-long   -isystem /usr/local/include/freetype2 -isystem /usr/local/include/libpng16
-isystem /usr/local/include -isystem /usr/local/include/harfbuzz -isystem /usr/local/include/glib-2.0 -isystem
/usr/local/lib64/glib-2.0/include -isystem /usr/local/include   

When I pass -E to the compiler, it prints:

# 317 "/usr/local/include/jmorecfg.h" 3 4
typedef enum { FALSE = 0, TRUE = 1 } boolean;
# 28 "/usr/local/include/jpeglib.h" 2 3 4

So #include "jpeglib.h" implies #include "jmorecfg.h" and libreoffice-
6.1.4.2/build/workdir/UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec_jpeg.cpp does #include "jpeglib.h".

This code:
typedef enum { a = 1, b = 2} c;

c x () {  return 2;}

also fails compiling with 
error: invalid conversion from ‘int’ to ‘c’ [-fpermissive]
 c x () {  return 2;}
                  ^
jmorecfg.h comes from jpeg9-c.  jpeg-turbo-1.5.3 has another jmorecfg.h, where boolean is defined as int.

Regards
  Дилян

On Thu, 2019-01-17 at 09:16 +0100, Stephan Bergmann wrote:
> [looks like the below didn't make it through to the list for some 
> reason, so resending:]
> 
> On 16/01/2019 15:46, Stephan Bergmann wrote:
> > On 16/01/2019 15:08, Дилян Палаузов wrote:
> > > I use gcc 8.2.1 20190101 with self buill linux.  I do not want to 
> > > compile LO linking with static libraries, which I have
> > > already as .so on my system, so no ./configure .
> > 
> > In which case you need to find out which of your system dependencies 
> > defines a type "boolean" in a way that the external/pdfium/ code doesn't 
> > expect and can't cope with.  (For me on Fedora 29 it would e.g. be
> > 
> > > #ifndef HAVE_BOOLEAN
> > > typedef int boolean;
> > > #endif
> > 
> > in /usr/include/jmorecfg.h from libjpeg-turbo-devel-2.0.0-1.fc29.x86_64.)
> 
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice



More information about the LibreOffice mailing list