]> andersk Git - splint.git/commitdiff
Fixed problem with comman line redefinitions (no filename).
authorevans1629 <evans1629>
Sat, 30 Mar 2002 20:24:21 +0000 (20:24 +0000)
committerevans1629 <evans1629>
Sat, 30 Mar 2002 20:24:21 +0000 (20:24 +0000)
src/fileloc.c
test/specclauses.expect

index 5cafa567a44c30accd22c5e99ba7a143d7f66e3a..55454b615f92d110676c1cb953c02b410eace4b7 100644 (file)
@@ -760,37 +760,51 @@ fileloc_unparse (fileloc f)
 /*@only@*/ cstring
 fileloc_unparseRaw (cstring fname, int lineno)
 {
-  bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
-
-  if (parenFormat)
+  if (!cstring_isEmpty (fname))
     {
-      return (message ("%q(%d)", osd_outputPath (fname), lineno));
+      bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
+      
+      if (parenFormat)
+       {
+         return (message ("%q(%d)", osd_outputPath (fname), lineno));
+       }
+      else
+       {
+         return (message ("%q:%d", osd_outputPath (fname), lineno));
+       }
     }
   else
     {
-      return (message ("%q:%d", osd_outputPath (fname), lineno));
+      return cstring_makeLiteral ("Command Line");
     }
 }
 
 /*@only@*/ cstring
 fileloc_unparseRawCol (cstring fname, int lineno, int col)
 {
-  if (context_getFlag (FLG_SHOWCOL)) 
+  if (!cstring_isEmpty (fname))
     {
-      bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
-      
-      if (parenFormat)
+      if (context_getFlag (FLG_SHOWCOL)) 
        {
-         return (message ("%q(%d,%d)", osd_outputPath (fname), lineno, col));
+         bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
+         
+         if (parenFormat)
+           {
+             return (message ("%q(%d,%d)", osd_outputPath (fname), lineno, col));
+           }
+         else
+           {
+             return (message ("%q:%d:%d", osd_outputPath (fname), lineno, col));
+           }
        }
       else
        {
-         return (message ("%q:%d:%d", osd_outputPath (fname), lineno, col));
+         return fileloc_unparseRaw (fname, lineno);
        }
     }
   else
     {
-      return fileloc_unparseRaw (fname, lineno);
+      return cstring_makeLiteral ("Command Line");
     }
 }
 
index 04a3972531f0f83b67f27002ffc16f6b09d8699c..d982d1c6febb0f801b09b056cc12411b83964a6a 100644 (file)
@@ -45,8 +45,8 @@ Finished checking --- 8 code warnings, as expected
 specclauses3.c:7:6: Special clause accesses field of non-struct or union result
                        (int): *(result).name
 specclauses3.c: (in function badResult)
-specclauses3.c:12:10: Undefined storage <const ?>->name corresponds to storage
-                         result->name listed in defines clause: NULL
+specclauses3.c:12:10: Undefined storage <const <any>>->name corresponds to
+                         storage result->name listed in defines clause: NULL
 specclauses3.c:12:10: Null storage returned as non-null: NULL
 specclauses3.c: (in function createName2)
 specclauses3.c:29:10: Undefined storage res->name corresponds to storage
This page took 0.058443 seconds and 5 git commands to generate.