[systemd-devel] [systemd-commits] 4 commits - catalog/systemd-fr.catalog catalog/systemd-ru.catalog configure.ac Makefile.am po/.gitignore po/LINGUAS po/ru.po

Lennart Poettering lennart at poettering.net
Mon Dec 2 07:58:40 PST 2013


On Sun, 01.12.13 01:26, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> 
> On Fri, Nov 29, 2013 at 02:45:21PM -0500, Colin Walters wrote:
> > On Fri, 2013-11-29 at 02:39 +0100, Lennart Poettering wrote:
> > > On Thu, 28.11.13 00:54, Zbigniew Jędrzejewski-Szmek (zbyszek at kemper.freedesktop.org) wrote:
> > 
> > > Instead we should add some code to macro.h which turns off the the
> > > warning with the #pragma stuff only if it detects it is being run on an
> > > old gcc.
> > 
> > There's also this approach:
> > 
> > 
> 
> > From 7affb075dd1889fbb6b8d8865dec4b5e1d36448f Mon Sep 17 00:00:00 2001
> > From: Colin Walters <walters at verbum.org>
> > Date: Fri, 29 Nov 2013 14:43:45 -0500
> > Subject: [PATCH] macro: Split assert_cc, add assert_cc_toplevel
> > 
> > To suppress warnings about -Wdeclaration-after-statement, we need to
> > wrap static asserts inside functions with a standard do {} while(0)
> > block.  But the toplevel asserts can't have that, so add
> > assert_cc_toplevel for those.
> Actually I don't think we need to totally forbid declarations after statements.
> This is not something likely to be introduced by mistake, so I think
> we'll be fine even if only humans check for that.

I must say I really dislike mixing declarations and code. And I also
know that by accident I did this in many cases myself and was thankful
for the compiler to tell me about this.

On newer gcc where static assert works correctly without warnings we
should totally make use of this with our current compiler flags.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list