Issue 71227 - warnings: GNU/Linux SPARC connectivity
Summary: warnings: GNU/Linux SPARC connectivity
Status: ACCEPTED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: current
Hardware: Sun Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 67001
  Show dependency tree
 
Reported: 2006-11-06 06:00 UTC by sparcmoz
Modified: 2013-02-07 21:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description sparcmoz 2006-11-06 06:00:53 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'
Comment 1 sparcmoz 2006-11-10 09:03:44 UTC
@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
Comment 2 Stephan Bergmann 2006-11-10 09:23:03 UTC
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.
Comment 3 sparcmoz 2006-11-10 10:58:37 UTC
@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 ;
Comment 4 sparcmoz 2006-11-15 09:41:54 UTC
@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.
 
Comment 5 Stephan Bergmann 2006-11-15 11:59:51 UTC
@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?
Comment 6 Frank Schönheit 2006-11-15 12:39:35 UTC
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.