This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Constant data in .c, not in a .h
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 8 Oct 2015 23:16:22 +0000 (19:16 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 9 Oct 2015 11:05:36 +0000 (07:05 -0400)
clang says:
./sdbm.h:54:20: warning: 'extern' variable has an initializer [-Wextern-initializer]

ext/SDBM_File/sdbm.c
ext/SDBM_File/sdbm.h

index 5241fea..cf5dc75 100644 (file)
@@ -48,6 +48,8 @@ extern Free_t free proto((Malloc_t));
 }
 #endif
 
+const datum nullitem = {0, 0};
+
 /*
  * forward
  */
index e7cf730..8d9cffd 100644 (file)
@@ -51,11 +51,7 @@ typedef struct {
        int dsize;
 } datum;
 
-extern const datum nullitem
-#ifdef DOINIT
-                        = {0, 0}
-#endif
-                                   ;
+extern const datum nullitem;
 
 #if defined(__STDC__) || defined(__cplusplus) || defined(CAN_PROTOTYPE)
 #define proto(p) p