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

 
 

bug #23827: Compilation fails with -D_FORTIFY_SOURCE=2

Submitted by:  Jordi Mallach <jordi>
Submitted on:  Sat 12 Jul 2008 02:00:39 PM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Chris Allegretta <astyanax>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by astyanax (Posted a comment)
  • -unavailable- added by jordi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Aug 2008 02:41:17 AM UTCastyanaxOpen/ClosedOpen=>Closed
    Sun 17 Aug 2008 05:00:21 PM UTCastyanaxSeverity3 - Normal=>4 - Important
      StatusNone=>Fixed
    Sun 13 Jul 2008 03:29:29 PM UTCastyanaxAssigned toNone=>astyanax
    Sat 12 Jul 2008 02:00:39 PM UTCjordiAttached File-=>Added open_flags.patch, #16109

    Back to the top


    Powered by Savane 3.1-cleanup1