Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Any other thoughts on whether this is a good idea to pursue?

It probably is, but with some caveats. My main concern would be unnecessary
code pollution. It's true that these warnings could be really useful. They
might hint at actual issues in some cases (for example an unhandled error
in the unused-result case). But suppressing them can also muddle the code.
I rather 'fix' the cases that might hide real issues rather than
suppress/silence noise just for its own sake.

One fear was that it might slow down compilation, but it doesn't actually
seem to slow down "make clean && make" much at all for me.  I'll get some
proper timing measurements.

Numbers are always a good reference. If it does slow down the build, it can
go as a special 'pedantic' flag or something. Possibly it could be added
such that (at least for now) it disables -Werror. This could be a good way
to fix the errors without affecting the project.


So, with a special configure flag, this can be used by those who want to
track-down potential issues and fix them without having to resolve every
paranoid warning.
I think the benefits from this flag outweighs the cost of adding it.

(Of course this is my 0.02 Swiss Franc's worth.)

On Thu, Jan 15, 2015 at 7:47 AM, Luke Deller <luke@deller.id.au> wrote:

Hi,

I saw that gcc-4.8 introduced a new optimization level -Og which enables
optimizations that do not interfere with debugging.

Yesterday I floated the idea on IRC of using this with --enable-debug
rather than -O0 if available, and some feedback was that it enables gcc to
report extra warnings which would be a good thing.

I tried it out and can see that it does indeed break the build if
--enable-werror is enabled, eg:

/home/deller/build/libo/vcl/unx/glxtest.cxx: In function ‘void glxtest()’:
/home/deller/build/libo/vcl/unx/glxtest.cxx:236:44: error: ignoring
return value of ‘ssize_t write(int, const void*, size_t)’, declared with
attribute warn_unused_result [-Werror=unused-result]
   write(write_end_of_the_pipe, buf, length);

So I guess this means we couldn't incorporate -Og until all these new
warnings are fixed right?

Any other thoughts on whether this is a good idea to pursue?  One fear was
that it might slow down compilation, but it doesn't actually seem to slow
down "make clean && make" much at all for me.  I'll get some proper timing
measurements.

(A draft patch is attached to enable -Og if available)

Regards,
Luke.

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.