Bug 93880 - libbsd: missing include in test/strmode.c
Summary: libbsd: missing include in test/strmode.c
Status: RESOLVED FIXED
Alias: None
Product: libbsd
Classification: Unclassified
Component: libbsd (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Guillem Jover
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-27 10:18 UTC by Hanno Böck
Modified: 2016-01-27 16:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch to add missing include (235 bytes, text/plain)
2016-01-27 10:18 UTC, Hanno Böck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Böck 2016-01-27 10:18:59 UTC
Created attachment 121321 [details]
patch to add missing include

The test in test/strmode.c can fail to compile depending on the optimization flags used.

The constants that are used in this file (S_IFREG etc.) come from the "sys/stat.h" include file. It seems gcc ignores this error if one compiles with "-O2" (default), but if one uses no optimization it fails.

Add the missing include and it works all the time, see attached patch. Please apply.

Reproduce:
./configure CFLAGS=""
make
make check

Error:
strmode.c: In function ‘main’:
strmode.c:41:17: error: ‘S_IFREG’ undeclared (first use in this function)
  strmode(0777 | S_IFREG, mode_str);
                 ^
strmode.c:41:17: note: each undeclared identifier is reported only once for each function it appears in
strmode.c:44:27: error: ‘S_ISUID’ undeclared (first use in this function)
  strmode(0777 | S_IFREG | S_ISUID | S_ISGID | S_ISVTX, mode_str);
                           ^
[...]
Comment 1 Guillem Jover 2016-01-27 16:28:48 UTC
Thanks! This has been merged and released as part of 0.8.2.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.