bug-combine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-combine] Added Headers For Compiler Warnings


From: Dave Spano
Subject: [Bug-combine] Added Headers For Compiler Warnings
Date: Wed, 28 May 2014 16:32:13 -0400 (EDT)

When compiling combine I got these warnings for the strlen, strcpy and _exit 
functions. 

main.c: In function ‘close_stdout’:
main.c:50:5: warning: incompatible implicit declaration of built-in function 
‘_exit’ [enabled by default]
     _exit (-1);
     ^
In file included from main.c:20:0:
main.c: In function ‘df_main’:
df_common.h:186:24: warning: incompatible implicit declaration of built-in 
function ‘strlen’ [enabled by default]
       tmp_str = malloc(strlen((Message)) + strlen(program_name) + 3);    \
                        ^
main.c:154:2: note: in expansion of macro ‘FATAL_PERROR’
  FATAL_PERROR (gs_data_output_file_name);
  ^
df_common.h:187:7: warning: incompatible implicit declaration of built-in 
function ‘strcpy’ [enabled by default]
       strcpy(tmp_str,program_name);                                     \


I added the unistd.h and string.h header files to make it go away. 

--- combine-0.4.0.orig/src/df_common.h
+++ combine-0.4.0/src/df_common.h
@@ -24,7 +24,11 @@ Foundation, Inc., 59 Temple Place - Suit
 #define _INTL_REDIRECT_MACROS

 #include "../config.h"
 #include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
 #include <math.h>
 #include "dstring.h"
 #include "extras.h"
@@ -188,7 +192,7 @@ Foundation, Inc., 59 Temple Place - Suit
       strcat(tmp_str,": ");                                             \
       strcat(tmp_str,(Message));                               \
       perror (tmp_str);                                                 \
-      free (tmp_str)  ;                                                 \
+      free (tmp_str);                                                 \
       exit(EXIT_FAILURE);                                               \
       } while(0)                                                        \

                                                                                
                                                                                
                                                            33,1          Bot


I had also noticed this error related to the index header structure, but I 
haven't had time to look at it. 

index.c: In function ‘initialize_index’:
index.c:65:28: warning: multi-character character constant [-Wmultichar]
   index_hdr.magic_number = 'DpV!';
                            ^
index.c: In function ‘open_index’:
index.c:116:33: warning: multi-character character constant [-Wmultichar]
   if (index_hdr.magic_number != 'DpV!' || index_hdr.version != 1)


-Dave Spano 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]