bugGNU nano - Bugs: bug #23827, Compilation fails with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #23827: Compilation fails with -D_FORTIFY_SOURCE=2

Submitter:  Jordi Mallach <jordi>
Submitted:  Sat 12 Jul 2008 02:00:39 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  astyanax Open/Closed:  Closed

Mon 25 Aug 2008 02:41:17 AM UTC, comment #3: 

Closing as 2.0.8 was released today which contains this fix.

Chris Allegretta <astyanax>
Group administrator
Sun 17 Aug 2008 05:00:21 PM UTC, comment #2: 

Well the Gentoo folks reported this too so clearly I'm the odd man out here :) Fixed in r4306 in trunk and r4307 in 2.0 branch.

Chris Allegretta <astyanax>
Group administrator
Sun 13 Jul 2008 03:29:30 PM UTC, comment #1: 

Jordi Im having trouble reproducing this.  Even after updating my Ubuntu Hardy system and adding -D_FORTIFY_SOURCE=2 I do see the warnings about ignoring return values, but not the fatal errors about not calling open with the 3rd arg.  I do agree that we should add those flags since according to the man page they shoudl really be specified, I'm curious why I dont get those errors; it it specific to a certain version of GCC or libc?

Chris Allegretta <astyanax>
Group administrator
Sat 12 Jul 2008 02:00:39 PM UTC, original submission:  

Ubuntu has switched their default CPP flags to include -D_FORTIFY_SOURCE=2, which breaks nano in a pair of uses of open():

In function 'open',
    inlined from 'write_file' at ../../src/files.c:1567:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
In function 'open',
    inlined from 'write_file' at ../../src/files.c:1686:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[3]: * [files.o] Error 1

I have uploaded the attached patch to Debian in 2.0.7-3, but Chris, can you have a look to see if the flags I added are enough or too many in both cases? Mostly because at the time of the patch creation (7:08) I suspect I was drunk still. :)

Ubuntu's original report:
https://bugs.edge.launchpad.net/ubuntu/+source/nano/+bug/247692
Some relevant information:
https://wiki.ubuntu.com/CompilerFlags

Jordi Mallach <jordi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #16109:  open_flags.patch added by jordi (612B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by astyanax (Posted a comment)
  • -email is unavailable- added by jordi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-25 astyanax Open/ClosedOpen Closed
    2008-08-17 astyanax Severity3 - Normal 4 - Important
        StatusNone Fixed
    2008-07-13 astyanax Assigned toNone astyanax
    2008-07-12 jordi Attached File- Added open_flags.patch, #16109

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code