View Issue Details

IDProjectCategoryView StatusLast Update
0002551SOGoSOPEpublic2014-02-04 08:57
Reporterbuzzdee Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSOpenBSDOS Version5.4-current
Product Version2.1.1b 
Target Version2.2.0Fixed in Version2.2.0 
Summary0002551: some format string fixes for sope-core/EOControl
Description

besides a few others, the fixes are mostly format string warning fixes, for the following warnings:

EOGenericRecord.m:67:1: warning: conflicting return type in implementation of 'version': 'NSInteger' (aka 'long') vs 'int' [-Wmismatched-return-types]

  • (int)version {
    ^ ~~~
    /usr/local/include/Foundation/NSObject.h:366:1: note: previous definition is here
  • (NSInteger) version;
    ^ ~~~~~
    1 warning generated.

    (unsigned int)count {
    ^ ~~~~
    ../EOControl/EOQualifier.h:88:1: note: previous definition is here

  • (NSUInteger)count;
    ^ ~~
    1 warning generated.

EOQualifierParser.m:378:13: warning: format specifies type 'int' but the argument has type 'NSUInteger' (aka 'unsigned long') [-Wformat]
[_qualifierFormat length], _qualifierFormat);
^~~~~~~~~
1 warning generated.

NSArray+EOQualifier.m:38:15: warning: expression result unused [-Wunused-value]
for (i = 0, count; i < count; i++) {
^~~~~
1 warning generated.

EOSQLParser.m:725:6: warning: format specifies type 'int' but the argument has type 'NSUInteger' (aka 'unsigned long') [-Wformat]
[[(EOAndQualifier *)q qualifiers] count]);
^~~~~~~~~~~~
EOSQLParser.m:743:6: warning: format specifies type 'int' but the argument has type 'NSUInteger' (aka 'unsigned long') [-Wformat]
[props count]);
^~~~~
4 warnings generated.

TagsNo tags attached.

Activities

buzzdee

buzzdee

2013-12-15 13:33

reporter  

warning-fixes-sope-core-EOControl.diff (2,605 bytes)   
$OpenBSD$
--- sope-core/EOControl/EOGenericRecord.m.orig	Sun Dec 15 19:16:42 2013
+++ sope-core/EOControl/EOGenericRecord.m	Sun Dec 15 19:18:06 2013
@@ -64,7 +64,7 @@ static __inline__ void eoRemove(EOGenericRecord *table
 
 static EONull *null = nil;
 
-+ (int)version {
++ (NSInteger)version {
   return 2;
 }
 
$OpenBSD$
--- sope-core/EOControl/EONotQualifier.m.orig	Sun Dec 15 19:18:51 2013
+++ sope-core/EOControl/EONotQualifier.m	Sun Dec 15 19:19:43 2013
@@ -48,7 +48,7 @@
   return self->qualifier;
 }
 
-- (unsigned int)count {
+- (NSUInteger)count {
   return self->qualifier ? 1 : 0;
 }
 - (NSArray *)subqualifiers {
$OpenBSD$
--- sope-core/EOControl/EOQualifierParser.m.orig	Sun Dec 15 19:19:51 2013
+++ sope-core/EOControl/EOQualifierParser.m	Sun Dec 15 19:20:47 2013
@@ -372,7 +372,7 @@ static NSString *_parseOp(const char *_buf, unsigned _
     
     if (length < bufLen) {
       NSLog(@"WARNING(%s): unexpected chars at the end of the "
-            @"string(class=%@,len=%i) '%@'",
+            @"string(class=%@,len=%"PRIuPTR") '%@'",
             __PRETTY_FUNCTION__,
             [_qualifierFormat class],
             [_qualifierFormat length], _qualifierFormat);
$OpenBSD$
--- sope-core/EOControl/NSArray+EOQualifier.m.orig	Sun Dec 15 19:20:57 2013
+++ sope-core/EOControl/NSArray+EOQualifier.m	Sun Dec 15 19:21:35 2013
@@ -28,14 +28,14 @@
   NSAutoreleasePool *pool;
   NSMutableArray *array = nil;
   NSArray  *result;
-  unsigned i, count;
+  NSUInteger i, count;
 
   pool = [[NSAutoreleasePool alloc] init];
   result = nil;
   
   count = [self count];
   array = [NSMutableArray arrayWithCapacity:count];
-  for (i = 0, count; i < count; i++) {
+  for (i = 0; i < count; i++) {
     id o;
     
     o = [self objectAtIndex:i];
$OpenBSD$
--- sope-core/EOControl/EOSQLParser.m.orig	Sun Dec 15 19:22:04 2013
+++ sope-core/EOControl/EOSQLParser.m	Sun Dec 15 19:22:45 2013
@@ -721,7 +721,7 @@ static inline BOOL isTokStopChar(unichar c) {
 	    NSStringFromClass([q class]));
     }
     else if ([[(EOAndQualifier *)q qualifiers] count] != 3) {
-      NSLog(@"  INVALID: expected 3 subqualifiers, got %i !",
+      NSLog(@"  INVALID: expected 3 subqualifiers, got %"PRIuPTR" !",
 	    [[(EOAndQualifier *)q qualifiers] count]);
     }
 
@@ -739,7 +739,7 @@ static inline BOOL isTokStopChar(unichar c) {
 	    NSStringFromClass([props class]));
     }
     else if ([props count] != 14) {
-      NSLog(@"  INVALID: invalid attribute count, expected 14, got %i.",
+      NSLog(@"  INVALID: invalid attribute count, expected 14, got %"PRIuPTR".",
 	    [props count]);
     }
   }
buzzdee

buzzdee

2014-01-15 13:29

reporter   ~0006398

ping

ludovic

ludovic

2014-02-04 08:57

administrator   ~0006482

https://github.com/inverse-inc/sope/commit/a8a123e9d7a8ade6a7214e8c994017cb3cc90067

Issue History

Date Modified Username Field Change
2013-12-15 13:33 buzzdee New Issue
2013-12-15 13:33 buzzdee File Added: warning-fixes-sope-core-EOControl.diff
2014-01-15 13:29 buzzdee Note Added: 0006398
2014-02-03 19:06 ludovic Target Version => 2.2.0
2014-02-04 08:57 ludovic Note Added: 0006482
2014-02-04 08:57 ludovic Status new => closed
2014-02-04 08:57 ludovic Assigned To => ludovic
2014-02-04 08:57 ludovic Resolution open => fixed
2014-02-04 08:57 ludovic Fixed in Version => 2.2.0