[MacPorts] #37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 ------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Keywords: | Port: Pallet @1.1.1 ------------------------+-------------------------------- Using OS X 10.7.5, Xcode 4.6 and Clang, I get about 50 syntax warnings when compiling the source code of Pallet in an Xcode 4.6 project. Attached are four patches to fix these. The patches are against SVN checkout on 7 Feb 2013. I have also re-worded some offensive text in a string in file MPQueueTableView.m.diff. -- Ticket URL: <https://trac.macports.org/ticket/37974> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 ----------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: Port: Pallet @1.1.1 | ----------------------------+-------------------------------- Comment (by egall@…): You might want to apply these conditionally; string literals are a newer Objective C feature, and I'm not sure how far backwards compatible they go... -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Changes (by ryandesign@…): * keywords: => haspatch * port: Pallet @1.1.1 => Pallet Comment: Replying to [ticket:37974 iandw.au@…]:
I have also re-worded some offensive text in a string in file MPQueueTableView.m.diff.
Changed this in r102780. I am not certain about the other changes. What were the warnings you received? -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) Comment: Replying to [comment:1 egall@…]:
You might want to apply these conditionally; string literals are a newer Objective C feature, and I'm not sure how far backwards compatible they go...
NSString literals have been around "forever" according to [http://blog.bignerdranch.com/398-objective-c-literals-part-1/ this blog post]; what's new in clang 3.2 are literals for NSNumber, NSArray, and NSDictionary. -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:4 ryandesign@…]:
Replying to [comment:1 egall@…]:
You might want to apply these conditionally; string literals are a newer Objective C feature, and I'm not sure how far backwards compatible they go...
NSString literals have been around "forever" according to [http://blog.bignerdranch.com/398-objective-c-literals-part-1/ this blog post]
Mac OS X 10.0’s GCC (which looks like it was 2.95.2, Apple build 926) [http://www.opensource.apple.com/source/gcc/gcc-926/gcc/c-lex.c recognized Objective-C string literals]. So yeah, we probably don’t have to worry too much about backwards compatibility on that front. -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Comment (by egall@…): Replying to [comment:5 larryv@…]:
Replying to [comment:4 ryandesign@…]:
Replying to [comment:1 egall@…]:
You might want to apply these conditionally; string literals are a newer Objective C feature, and I'm not sure how far backwards compatible they go...
NSString literals have been around "forever" according to [http://blog.bignerdranch.com/398-objective-c-literals-part-1/ this blog post]; what's new in clang 3.2 are literals for NSNumber, NSArray, and NSDictionary.
Mac OS X 10.0’s GCC (which looks like it was 2.95.2, Apple build 926) [http://www.opensource.apple.com/source/gcc/gcc-926/gcc/c-lex.c recognized Objective-C string literals]. So yeah, we probably don’t have to worry too much about backwards compatibility on that front.
Right, I was getting my different types of literals confused... guess that means it's probably safe to commit then. -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:6 egall@…]:
Right, I was getting my different types of literals confused...
“we heard you like @ signs…” —Apple -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:3 ryandesign@…]:
Changed this in r102780. I am not certain about the other changes. What were the warnings you received?
From eyeballing it, it looks like the warnings are either: - `printf`-style format specifiers that don’t quite match the arguments given. These should be fine to commit; plus, they’re just for logging. - Redundant invocations of `[NSString +stringWithString]` with an NSString literal argument. Those might once have been necessary for memory management. -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37974: Pallet @1.1.1 Patches for syntax warnings when using Clang and Xcode 4.6 -------------------------+-------------------------------- Reporter: iandw.au@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Low | Milestone: Component: contrib | Version: 2.1.3 Resolution: | Keywords: haspatch Port: Pallet | -------------------------+-------------------------------- Comment (by iandw.au@…): Replying to [comment:3 ryandesign@…]:
Replying to [ticket:37974 iandw.au@…]:
I have also re-worded some offensive text in a string in file MPQueueTableView.m.diff.
Changed this in r102780. I am not certain about the other changes. What were the warnings you received?
Examples of the warning messages I was getting are shown below, as comments, along with "before and after" code. 1) NSLog(@"Default variants count: %i", [defaultVariants count]); // Values of type 'NSUInteger' should not be used as format arguments; // add an explicit cast to 'unsigned long' instead NSLog(@"Default variants count: %li", (unsigned long)[defaultVariants count]); 2) [variants addObject: [NSString stringWithString:@"+"]]; // Using 'stringWithString' with a literal is redundant [variants addObject: @"+"]; These examples are from file MPActionsController.m. BTW, Pallet was written by GSoC students in 2009 and 2010, so is not very old. -- Ticket URL: <https://trac.macports.org/ticket/37974#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts