bugGNUstep - Bugs: bug #39328, EOModelEditor: generated ObjC...

Group
 
 

bug #39328: EOModelEditor: generated ObjC files cause warnings with clang

Submitter:  Graham Lee <leeg>
Submitted:  Sun 23 Jun 2013 04:21:15 PM UTC
   
 
Category:  gdl2 Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  buzzdee
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 12 Aug 2013 03:27:36 PM UTC, comment #1: 

The patch got applied with svn rev: 36967

thanks

Sebastian Reitenbach <buzzdee>
Group Member
Sun 23 Jun 2013 04:21:15 PM UTC, original submission:  

Specifically the setters have too many parentheses in their test:

- (void) setPersonName:(NSString *) aValue
{
  if ((_personName == aValue)) {
    return;
  }

  [self willChange];
  ASSIGN(_personName, aValue);
}

Clang, when used to build a gsw app containing this file, complains thus:

_Person.m:36:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
  if ((_personName == aValue)) {
       ~~~~~~~~~~~~^~~~~~~~~
_Person.m:36:20: note: remove extraneous parentheses around the comparison to silence this warning
  if ((_personName == aValue)) {
      ~            ^        ~
_Person.m:36:20: note: use '=' to turn this equality comparison into an assignment
  if ((_personName == aValue)) {
                   ^~
                   =

The attached patch simply removes one set of parentheses (I suppose a different approach would be to use -isEqual: for non-primitive tests, which would short-cut the "like for like" path in assignment).

Graham Lee <leeg>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #28392:  codegenerator.patch added by leeg (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by buzzdee (Posted a comment)
  • -email is unavailable- added by leeg (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.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-12 buzzdee StatusNone Fixed
        Assigned toNone buzzdee
        Open/ClosedOpen Closed
    2013-06-23 leeg Attached File- Added codegenerator.patch, #28392

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code