v39lfy / google-toolbox-for-mac

Automatically exported from code.google.com/p/google-toolbox-for-mac
Apache License 2.0
0 stars 0 forks source link

deprecation as errors for GTMiPhoneUnitTesting in 3.1.2 SDK on snow-leopard (Xcode 3.2.x) #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
svn version 254 demonstrates a some issues when compiling for iPhone
simulator 3.0 and 3.1.2: 

the compilation output is listed below. 

What steps will reproduce the problem?
1. xcode 3.1.2
2. compile for 10.1.6

suggested patch:

Index: Foundation/GTMNSObject+KeyValueObserving.m
===================================================================
--- Foundation/GTMNSObject+KeyValueObserving.m  (revision 254)
+++ Foundation/GTMNSObject+KeyValueObserving.m  (working copy)
@@ -156,6 +156,9 @@

 @end

+extern int objc_atomicCompareAndSwapGlobalBarrier(void*, void*, void*); 
+
+
 @implementation GTMKeyValueObservingCenter

 + (id)defaultCenter {
Index: Foundation/GTMLoggerTest.m
===================================================================
--- Foundation/GTMLoggerTest.m  (revision 254)
+++ Foundation/GTMLoggerTest.m  (working copy)
@@ -295,7 +295,7 @@
   [fh logMessage:@"test 4" level:kGTMLoggerLevelAssert];
   [fh closeFile];

-  NSString *contents = [NSString stringWithContentsOfFile:path_];
+  NSString *contents = [NSString stringWithContentsOfFile:path_
encoding:NSUTF8StringEncoding error:nil];

   STAssertEqualObjects(@"test 0\ntest 1\ntest 2\ntest 3\ntest 4\n",
contents, nil);
 }
@@ -458,7 +458,7 @@
   [fh logMessage:@"test 6" level:kGTMLoggerLevelInfo];
   [fh closeFile];

-  NSString *contents = [NSString stringWithContentsOfFile:path_];
+  NSString *contents = [NSString stringWithContentsOfFile:path_
encoding:NSUTF8StringEncoding error:nil];
   STAssertNotNil(contents, nil);
   STAssertEqualObjects(@"test 1\ntest 2\ntest 3\ntest 4\ntest 5\ntest
6\n", contents, nil);  
 }
Index: Foundation/GTMNSFileManager+PathTest.m
===================================================================
--- Foundation/GTMNSFileManager+PathTest.m  (revision 254)
+++ Foundation/GTMNSFileManager+PathTest.m  (working copy)
@@ -141,7 +141,7 @@
     }
     for (size_t j = 0; j < sizeof(testFiles) / sizeof(NSString*); j++) {
       NSString *testFile = [testDir
stringByAppendingPathComponent:testFiles[j]];
-      STAssertTrue([@"test" writeToFile:testFile atomically:YES], nil);
+      STAssertTrue([@"test" writeToFile:testFile atomically:YES
encoding:NSUTF8StringEncoding error:nil], nil);
     }
   }

CompileC
build/GTMiPhone.build/Debug-iphonesimulator/GTMiPhoneUnitTesting.build/Objects-n
ormal/i386/GTMNSFileManager+PathTest.o
Foundation/GTMNSFileManager+PathTest.m normal i386 objective-c
com.apple.compilers.gcc.4_2
cd /Users/mwinter/tmp/google-toolbox-for-mac
setenv LANG en_US.US-ASCII
setenv PATH
"/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/
bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
/Developer/usr/bin:/usr/X11/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x
objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs
-fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic -Werror -Wreturn-type
-Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label
-Wunused-variable -Wunused-value -Wunknown-pragmas -Wshadow -Wnewline-eof
-D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_DEBUG -D_GLIBCPP_CONCEPT_CHECKS
-DDEBUG=1 -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -isysroot
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.
sdk
-fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote
/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesimu
lator/GTMiPhoneUnitTesting.build/GTMiPhoneTest-generated-files.hmap
-I/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesi
mulator/GTMiPhoneUnitTesting.build/GTMiPhoneTest-own-target-headers.hmap
-I/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesi
mulator/GTMiPhoneUnitTesting.build/GTMiPhoneTest-all-target-headers.hmap
-iquote
/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesimu
lator/GTMiPhoneUnitTesting.build/GTMiPhoneTest-project-headers.hmap
-Wall -Wendif-labels -Winvalid-pch -Wformat=2 -Wmissing-format-attribute
-Wwrite-strings -Wstack-protector -Wstrict-aliasing=2 -Wpacked
-Wmissing-field-initializers -Wextra -Wno-unused-parameter -Wpointer-arith
-Wdisabled-optimization -Wfloat-equal
-F/Users/mwinter/tmp/google-toolbox-for-mac/build/Debug-iphonesimulator
-I/Users/mwinter/tmp/google-toolbox-for-mac/build/Debug-iphonesimulator/include
-I/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesi
mulator/GTMiPhoneUnitTesting.build/DerivedSources/i386
-I/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesi
mulator/GTMiPhoneUnitTesting.build/DerivedSources
-Wdiv-by-zero -Wbad-function-cast -Wnested-externs -Wold-style-definition
-fstack-protector -fstack-protector-all -include
/var/folders/h+/h+AKwl6EGhuQQkkrG6PCMk+++TI/-Caches-/com.apple.Xcode.501/SharedP
recompiledHeaders/GTM_Prefix-aujutpcpiljyurcgaitldeskopbz/GTM_Prefix.pch
-c
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSFileManager+PathTest.m
-o
/Users/mwinter/tmp/google-toolbox-for-mac/build/GTMiPhone.build/Debug-iphonesimu
lator/GTMiPhoneUnitTesting.build/Objects-normal/i386/GTMNSFileManager+PathTest.o

cc1obj: warnings being treated as errors
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSFileManager+PathTest.m
:
In function '-[GTMNSFileManager_PathTest
testfilePathsWithExtensionsInDirectory]':
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSFileManager+PathTest.m
:144:
warning: 'writeToFile:atomically:' is deprecated (declared at
/Developer/Platforms/iPhoneSimulator.platform

cc1obj: warnings being treated as errors
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMLoggerTest.m: In
function '-[GTMLoggerTest testFileHandleWriter]':
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMLoggerTest.m:298:
warning: 'stringWithContentsOfFile:' is deprecated (declared at
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.
sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:357)
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMLoggerTest.m: In
function '-[GTMLoggerTest testFileHandleCreation]':
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMLoggerTest.m:461:
warning: 'stringWithContentsOfFile:' is deprecated
cc1obj: warnings being treated as errors
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSObject+KeyValueObservi
ng.m:
In function '+[GTMKeyValueObservingCenter defaultCenter]':
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSObject+KeyValueObservi
ng.m:169:
warning: implicit declaration of function
'objc_atomicCompareAndSwapGlobalBarrier'
/Users/mwinter/tmp/google-toolbox-for-mac/Foundation/GTMNSObject+KeyValueObservi
ng.m:169:
warning: nested extern declaration of 'objc_atomicCompareAndSwapGlobalBarrier'

Original issue reported on code.google.com by msud...@gmail.com on 16 Nov 2009 at 4:52

GoogleCodeExporter commented 9 years ago
Dave and I have been pretty swamped, but we're working on these and a few other 
issues with the updated tool chain.

Original comment by thoma...@gmail.com on 20 Nov 2009 at 6:39

GoogleCodeExporter commented 9 years ago
fyi - I'm landing a cl to put better support for all the iphone sdks in, but 
Apple has made 
things a little challenging, the SDKs that ship with Xcode 3.2.x and 3.1.x 
don't trigger 
the same warnings.  We see this on iPhone and MacOS.  This is one of the things 
Dave 
and I are still trying to deal with.

Original comment by thoma...@gmail.com on 20 Nov 2009 at 7:51

GoogleCodeExporter commented 9 years ago
Is there another option for processing zip files in memory that I can use until 
the toolbox if fixed.  I cant go to 
an older OS unfortunately.

Original comment by iCDSCre...@gmail.com on 26 Nov 2009 at 7:12

GoogleCodeExporter commented 9 years ago
Jamesazucker - zip or zlib?  what is the issue?

Original comment by thoma...@gmail.com on 27 Nov 2009 at 3:19

GoogleCodeExporter commented 9 years ago
I am working on an application to download a .zip archive that contains market 
data xmls.  I was planning to use 
the toolkit for unziping and extacting the documents in memory(they are 
small...).  Can you suggest how I can 
maybe comment out some section of the toolkit so I can progress this weekend. 
(This is the first time I've looked 
at the toolkit, so I am not familiar with it yet to hack it myself quickly as I 
am sure I can live without the feature 
that is cribbing as it is file based work.)

Original comment by iCDSCre...@gmail.com on 27 Nov 2009 at 3:16

GoogleCodeExporter commented 9 years ago
jamesazucker - This issue is for issues with the iPhone 3.1.x SDK when building 
on 10.6, so it doesn't seem 
related to what you're commented on.  As far as zip support, 
Foundation/NSData+zlib has support for zlib 
streams and gzip file directly, but not for .zip archives (as they can have 
multiple files, not a single payload).  If 
you'd like to contribute something back for handling zip archives, it could be 
built on top of what is already 
there, just doesn't exist in GTM yet.

Original comment by thoma...@gmail.com on 27 Nov 2009 at 3:50

GoogleCodeExporter commented 9 years ago

Original comment by thoma...@gmail.com on 27 Nov 2009 at 3:51

GoogleCodeExporter commented 9 years ago
Thomas,  I am trying to build the toolbox on the target you have specified, I 
think the NSData+zlib will work for 
me, if not I will adapt it and contribute, but I need to get the toolkit 
compiling on my target to accomplish that.  I 
will extract these one class and see if I can get it working without the 
toolkit.

Original comment by iCDSCre...@gmail.com on 27 Nov 2009 at 4:07

GoogleCodeExporter commented 9 years ago
I believe all of these are fixed for the Xcode 3.2.x tool chain.  Let me know 
if I missed anything.

Original comment by thoma...@gmail.com on 28 Nov 2009 at 7:26