[ 
https://issues.apache.org/jira/browse/THRIFT-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117698#comment-14117698
 ] 

Hudson commented on THRIFT-2676:
--------------------------------

SUCCESS: Integrated in Thrift #1268 (See 
[https://builds.apache.org/job/Thrift/1268/])
THRIFT-2676 Avoid 'i386' name collision in generated Cocoa/objc code (roger: 
rev e26a19bba0a91e31d0ec8092940992534426a26f)
* compiler/cpp/src/generate/t_cocoa_generator.cc


> Cocoa code generator emits reserved symbol, 'i386'
> --------------------------------------------------
>
>                 Key: THRIFT-2676
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2676
>             Project: Thrift
>          Issue Type: Bug
>          Components: Cocoa - Compiler
>         Environment: Xcode 5 (iOS)
> Xcode 6 (iOS)
>            Reporter: Keith Lazuka
>            Assignee: Roger Meier
>
> The Cocoa code generator has a bug where it can generate a local variable 
> that conflicts with a symbol defined in the iOS SDK. Specifically, it happens 
> when the temporary variable counter reaches the value `386` when emitting an 
> index variable for a for-loop in 
> `t_cocoa_generator::generate_serialize_container()`. The offending symbol is 
> `i386` which apparently is #define'd to equal `1` somewhere in the iOS 
> toolchain.
> This test code demonstrates the problem, regardless of Thrift codegen.
> {noformat}
>     int i386 = 42;
>     printf("foobar %d\n", i386);
> {noformat}
> Which results in the following compiler error:
> {noformat}
> /Users/keith/Desktop/ReservedSymbolTest/ReservedSymbolTest/ViewController.m:22:7:
>  error: expected identifier or '('
>   int i386 = 42;
>       ^
> <built-in>:143:14: note: expanded from here
>              ^
> 1 error generated.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to