Apache OpenOffice (AOO) Bugzilla – Issue 71227
warnings: GNU/Linux SPARC connectivity
Last modified: 2013-02-07 21:52:34 UTC
Using gcc 4.1.2 in connectivity with warnings as errors. I suppose this will affect all gcc eventually, so I can wait. Meanwhile I am reporting in case it is important. /../../unxlngs.pro/slo/MMozillaBootstrap.o /home/jim/vanilla/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx cc1plus: warnings being treated as errors /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.h: In member function 'const E* com::sun::star::uno::Sequence< <template-parameter-1-1> >::getConstArray() const [with E = rtl::OUString]': /home/jim/vanilla/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx:128: instantiated from here /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.h:183: warning: cast from 'char*' to 'const rtl::OUString*' increases required alignment of target type /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.hxx: In member function 'E* com::sun::star::uno::Sequence< <template-parameter-1-1> >::getArray() [with E = rtl::OUString]': /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.hxx:201: instantiated from 'E& com::sun::star::uno::Sequence< <template-parameter-1-1> >::operator[](sal_Int32) [with E = rtl::OUString]' /home/jim/vanilla/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx:114: instantiated from here /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.hxx:191: warning: cast from 'char*' to 'rtl::OUString*' increases required alignment of target type dmake: Error code 1, while making '../../../../unxlngs.pro/slo/MMozillaBootstrap.obj'
@sb: any suggestions would be appreciated. what to do about this... /home/jim/vanilla/solver/680/unxlngs.pro/inc/com/sun/star/uno/Sequence.h:183: warning: cast from 'char*' to 'const rtl::OUString*' increases required alignment of target type
I do not see an easy workaround. This boils down to how struct _sal_Sequence is defined at sal/inc/sal/types.h:1.29 l. 258. Maybe it would help to silence the warning by changing from char * -> reinterpret_cast to E * to char * -> static_cast to void * -> reinterpret_cast to E * Anyway, from <http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Warning-Options.html#Warning-Options> I understand that this warning should only be issued if -Wcast-align is specified, but I do not find that in solenv/inc/unxlngs.mk:1.19 (which is the file you are using on Linux SPARC, right?). Maybe -Wcast-align is implied by some other compiler switch and it would help to globally silence this warning via -Wno-cast-align.
@sb: thanks. using your hint I find the switch is in here: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/bootstrap/ makefile.mk Others have been poking around in there so I have some good examples to follow ;
@sb: any comment would be appreciated. I think the best step is to not activate warnings are errors for connectivity on GNU/Linux SPARC. So it will be added to the list of modules in unxlngs.mk. After cws jw2 is committed this will be my only module with warnings, apart from those already listed in unxlngi6.mk. My reasons are, after looking into connectivity/source/drivers/mozab/bootstrap/makefile.mk: (a) If I patch the makefile.mk I would need to disable -Wno-cast-align for all files in the directory, and do not like to hide any warnings when I do not know anything about that; (b) the makefile looks odd anyway, there are flags like -fPIC (already in unxlngs.mk) and -g (for debug builds?)and I do not understand why they are in there; (c) If I am to disable the warning, I do not have enough information to know if it should be disabled for either GNU/Linux SPARC or gcc4.1.2 or both; Therefore I propose to leave this module with warnings not errors and wait and see if anyone else runs into this later, meanwhile will close as wontfix.
@fs: Can you comment on why connectivity/source/drivers/mozab/bootstrap/makefile.mk sets up all the compiler/linker flags itself, instead of relying on settings.mk etc.? Should this be cleaned up?
no idea, sorry. The files were originally created by people not working at OOo anymore, and I do not know the reasoning. Might be there was a good reason (at least for some of the explicit switches), might be it was lack of knowledge about our build system. In any way, I suppose selectively removing some of those explicit switches - in particular -Wcast-align - will not hurt. I could imagine that some switches are necessary to ensure the files are compatible with the built mozilla libraries (into which they call at runtime), but that's a guess only, and certainly doesn't apply to warnings.