bugGNUstep - Bugs: bug #39087, Various format specifier problems...

 
 

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

bug #39087: Various format specifier problems cause build to fail

Submitted by:  Graham Lee <leeg>
Submitted on:  Mon 27 May 2013 08:21:05 PM UTC  
 
Category: gswebSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Sebastian Reitenbach <buzzdee>
Open/Closed: Closed

Wed 29 May 2013 05:46:04 PM UTC, comment #4:

That's great, now it builds cleanly for me too :). Thanks!

Graham Lee <leeg>
Wed 29 May 2013 05:09:57 PM UTC, comment #3:

Hi Graham,

svn rev. 36679 now should fix the addressed issues, but I used the PRIuPTR types defined in inttypes.h instead of your approach.

Let me know if that works for you too.

Sebastian Reitenbach <buzzdee>
Project MemberIn charge of this item.
Tue 28 May 2013 03:45:19 PM UTC, comment #2:

Thanks for looking at the patch. I've just checked the GNU coding standards (and should've done so in advance):

> Don’t make the program ugly just to placate static analysis tools such as lint, clang, and GCC with extra warnings options such as -Wconversion and -Wundef. These tools can help find bugs and unclear code, but they can also generate so many false alarms that it hurts readability to silence them with unnecessary casts, wrappers, and other complications. For example, please don’t insert casts to void or calls to do-nothing functions merely to pacify a lint checker.


so maybe the appropriate fix is to turn off that warning, instead of this patch :-(.

Graham Lee <leeg>
Tue 28 May 2013 03:26:48 PM UTC, comment #1:

The patch looks good, applies fine, and doesn't seem to cause any trouble. But normally, I use the PRIuPTR, and PRIiPTR format specifiers from inttypes.h, to prevent all that casting, which I find more ugly than those format specifiers. But that is only my personal taste.
Anyway, your way is also good, so let's see what David has to say about it, then it will get addressed the one or other way.

Thanks,
Sebastian

Sebastian Reitenbach <buzzdee>
Project MemberIn charge of this item.
Mon 27 May 2013 08:21:05 PM UTC, original submission:

I'm using clang (from Xcode 4.6.2), and building GSW on the Apple platform. The build has -Werror specified, and many of the build errors that ensue are due to format specifiers not matching the type being substituted.

There are other problems too, but I've fixed those in a separate patch because there's something to discuss here. A lot of the format specifier problems relate to use of NSUInteger in printf-style strings: the Apple clang build doesn't like that because NSUInteger can be different lengths on their different platforms (unsigned int on 32-bit, unsigned long on 64-bit).

Apple recommend using %lu and casting the argument to (unsigned long), which is the route I've chosen in the attached patch. I assume that's appropriate on every platform GNUstep/GSWeb supports, but wanted to explicitly flag the fact that I'd made this decision in preparing the patch.

Graham Lee <leeg>

 

Attached Files
file #28188:  gsw-formatspecifiers.patch added by leeg (15kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by buzzdee (Posted a comment)
  • -unavailable- added by leeg (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
    Sat 21 Dec 2013 07:11:07 AM UTCbuzzdeeOpen/ClosedOpen=>Closed
    Wed 29 May 2013 08:57:08 PM UTCbuzzdeeStatusReady For Test=>Fixed
    Wed 29 May 2013 05:09:57 PM UTCbuzzdeeStatusNone=>Ready For Test
      Assigned toNone=>buzzdee
    Mon 27 May 2013 08:21:05 PM UTCleegAttached File-=>Added gsw-formatspecifiers.patch, #28188

    Back to the top


    Powered by Savane 3.1-cleanup