Processed: breaks when #included after

2018-05-15 Thread Debian Bug Tracking System
Processing control commands:

> affects -1 + src:systemd libmount-dev
Bug #898743 [linux-libc-dev,libc6-dev]  breaks when #included 
after 
Added indication that 898743 affects src:systemd and libmount-dev

-- 
898743: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898743
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#898743: breaks when #included after

2018-05-15 Thread Helmut Grohne
Package: linux-libc-dev,libc6-dev
Severity: serious
Justification: makes systemd ftbfs
User: helm...@debian.org
Usertags: rebootstrap
Control: affects -1 + src:systemd libmount-dev

systemd FTBFS here, because compiling load-fragment.c fails. I spent a while
minimizing that file and it boils down to:

$ cat test.c
#include 
#include 
$ gcc -c test.c
In file included from test.c:1:0:
/usr/include/x86_64-linux-gnu/sys/mount.h:35:3: error: expected identifier 
before numeric constant
   MS_RDONLY = 1,  /* Mount read-only.  */
   ^
$

linux/fs.h #defines MS_RDONLY and then sys/mount.h tries to create an
enum containing MS_RDONLY. That's a problem.

This is also known in fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1497501

That bug hints that sometimes headers need to #included in a certain
order. If that is the case, this bug should be reassigned to src:systemd
asking that  or  must be #included before
. It also means that  should #include
 before defining its own copies of these macros.

Helmut

PS: Let me briefly curse systemd for their use of cyclic #includes
(unit.h <-> cgroup.h) and #pragma once as that works pretty badly
with creduce. Thank you.