From: Kevin McCarthy Date: Sat, 18 Mar 2017 20:38:20 +0000 (-0700) Subject: Fix conststrings type mismatches. (closes #3926) X-Git-Tag: neomutt-20170414~26^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46bafa918bc49b52c9ee29c308f70782f8cf8c5f;p=neomutt Fix conststrings type mismatches. (closes #3926) The generation programs for conststrings.c: txt2c.c and txt2c.sh, specified the resultant types as "unsigned char[]" while version.c declared them as "const char[]". txt2.c generates 0xXX hex codes for each individual character, thus the "unsigned" definition. With link-time optimization, some versions of gcc notice the mismatch and emit a warning. Change the declarations to match the definitions and cast to char[] when they are used. --- diff --git a/version.c b/version.c index 6845a8db2..93804972f 100644 --- a/version.c +++ b/version.c @@ -44,9 +44,9 @@ const char * mutt_hcache_backend_list (void); const int SCREEN_WIDTH = 80; -extern const char cc_version[]; -extern const char cc_cflags[]; -extern const char configure_options[]; +extern unsigned char cc_version[]; +extern unsigned char cc_cflags[]; +extern unsigned char configure_options[]; static const char *Copyright = N_( "Copyright (C) 1996-2016 Michael R. Elkins \n" @@ -439,13 +439,13 @@ print_version (void) puts ("\n\nCompiler:"); rstrip_in_place ((char *) cc_version); - puts (cc_version); + puts ((char *)cc_version); rstrip_in_place ((char *) configure_options); - printf ("\nConfigure options: %s\n", configure_options); + printf ("\nConfigure options: %s\n", (char *)configure_options); rstrip_in_place ((char *) cc_cflags); - printf ("\nCompilation CFLAGS: %s\n", cc_cflags); + printf ("\nCompilation CFLAGS: %s\n", (char *)cc_cflags); puts (_("\nCompile options:")); print_compile_options();