Bug 219 - Error when compiling Akai.cpp with -D_FORTIFY_SOURCE=2
Summary: Error when compiling Akai.cpp with -D_FORTIFY_SOURCE=2
Alias: None
Product: libgig
Classification: Unclassified
Component: libgig (show other bugs)
Version: SVN Trunk
Hardware: PC Linux
: P5 normal
Assignee: Christian Schoenebeck
Depends on:
Reported: 2014-05-29 04:12 CEST by Chris Arndt
Modified: 2014-08-24 18:47 CEST (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Arndt 2014-05-29 04:12:05 CEST
When -D_FORTIFY_SOURCE=2 preprocessor macro is used, compilation of Akai.cpp fails with an error:

In function 'int open(const char*, int, ...)',
    inlined from 'bool DiskImage::WriteImage(const char*)' at Akai.cpp:1880:66:
/usr/include/bits/fcntl2.h:50:26: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
    __open_missing_mode ();

(Full log here: http://pastebin.com/MwcvtnTr)

With -D_FORTIFY_SOURCE=2 a call to open with the O_CREAT flag needs to specify a file permission mode as the third argument. Here's a patch that fixes this:


AFAIK -D_FORTIFY_SOURCE=2 is in the default CPP_FLAGS of the package build system in many distributions, for example Arch Linux, so libgig should be compatible with it.
Comment 1 Christian Schoenebeck 2014-06-01 02:32:04 CEST
Fixed in SVN r2587. Thanks!