[PATCH] build problem with gcc 4.5.2

Terrence Enger tenger at iseries-guru.com
Sat Jul 7 09:10:38 PDT 2012


Around 2012-07-07 00:45 UTC, I pulled master commit 2758492 and tried
to build on ubuntu-natty (11.04), which has gcc version 4.5.2.  The
gcc compiles downstream from files cfglex.l, xrmlex.l, and srclex.l in
l10ntools/source/ each failed with the message

    error: unknown option after ‘#pragma GCC diagnostic’ kind

Each time, the offending line was

    #pragma GCC diagnostic ignored "-Wunused-but-set-variable"


Taking a hint from <https://lkml.org/lkml/2011/7/26/488>, I
conditioned the three lines by

    #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))

which allows a successful build.  I attach a patch, just in case this
situation of interest and this is the right solution; my blanket
licence statement is on file.


My setup of gedit also removed trailing spaces from two lines in each
of srclex.l and xrmlex.l.  I understand that trailing spaces are
generally not wanted, so I am not trying to fix this accident.


<aside>
  After I changed the three .l files, the build system picked up the
  changes without any "clean".  So I am left wondering how my build of
  master commit 96caa3b (2012-06-07) succeeded after the offending
  #pragma was added to cfglex.l on 2012-05-02.  Ah well, nowhere is it
  written that I shall understand everything.
</aside>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Wunused-but-set-variable-was-new-in-gcc-4.6 at REPO@.patch
Type: text/x-patch
Size: 2700 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120707/8070091b/attachment.bin>


More information about the LibreOffice mailing list