public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [buildrobot][PATCH]: gas/config/tc-score.c:4492: error: missing braces around initializer
@ 2013-10-14 19:20 Jan-Benedict Glaw
  2013-10-16 19:39 ` [ping] " Jan-Benedict Glaw
  0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2013-10-14 19:20 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils

[-- Attachment #1: Type: text/plain, Size: 5033 bytes --]

Hi!

I think this is another fallout of the cppcheck silencing:

gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils/gas  -I. -I/home/jbglaw/repos/binutils/gas -I../bfd -I/home/jbglaw/repos/binutils/gas/config -I/home/jbglaw/repos/binutils/gas/../include -I/home/jbglaw/repos/binutils/gas/.. -I/home/jbglaw/repos/binutils/gas/../bfd -DLOCALEDIR="\"/home/jbglaw/build/score-elf/_install_/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT tc-score.o -MD -MP -MF .deps/tc-score.Tpo -c -o tc-score.o `test -f 'config/tc-score.c' || echo '/home/jbglaw/repos/binutils/gas/'`config/tc-score.c
cc1: warnings being treated as errors
/home/jbglaw/repos/binutils/gas/config/tc-score.c: In function ‘s3_do_macro_bcmp’:
/home/jbglaw/repos/binutils/gas/config/tc-score.c:4492: error: missing braces around initializer
/home/jbglaw/repos/binutils/gas/config/tc-score.c:4492: error: (near initialization for ‘inst_main.name’)
/home/jbglaw/repos/binutils/gas/config/tc-score.c:4492: error: missing initializer
/home/jbglaw/repos/binutils/gas/config/tc-score.c:4492: error: (near initialization for ‘inst_main.instruction’)
make[3]: *** [tc-score.o] Error 1

This is from gcc76 (cfarm machine), you can find the full build log
here:
http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=19332
http://toolchain.lug-owl.de/buildbot/deliver_artifact.php?mode=view&id=69223

While the "missing initializer" warning is actually wrong, it's right
that there are braces missing around the char[] initializer:

 383 struct s3_score_it
 384 {
 385   char name[s3_INSN_NAME_LEN];
 386   bfd_vma instruction;
 387   bfd_vma relax_inst;
 388   int size;
 389   int relax_size;
 390   enum score_insn_type type;
 391   char str[s3_MAX_LITERAL_POOL_SIZE];
 392   const char *error;
 393   int bwarn;
 394   char reg[s3_INSN_NAME_LEN];
 395   struct
 396   {
 397     bfd_reloc_code_real_type type;
 398     expressionS exp;
 399     int pc_rel;
 400   }reloc;
 401 };
[...]
4492   struct s3_score_it inst_main = { 0 };


A similar error (though due to a bogus warning) is generated for tic6x
(see
http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=19186
and
http://toolchain.lug-owl.de/buildbot/deliver_artifact.php?mode=view&id=67284):

gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils/gas  -I. -I/home/jbglaw/repos/binutils/gas -I../bfd -I/home/jbglaw/repos/binutils/gas/config -I/home/jbglaw/repos/binutils/gas/../include -I/home/jbglaw/repos/binutils/gas/.. -I/home/jbglaw/repos/binutils/gas/../bfd -DLOCALEDIR="\"/home/jbglaw/build/tic6x-uclinux/_install_/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT tc-tic6x.o -MD -MP -MF .deps/tc-tic6x.Tpo -c -o tc-tic6x.o `test -f 'config/tc-tic6x.c' || echo '/home/jbglaw/repos/binutils/gas/'`config/tc-tic6x.c
cc1: warnings being treated as errors
/home/jbglaw/repos/binutils/gas/config/tc-tic6x.c: In function ‘tic6x_parse_operand’:
/home/jbglaw/repos/binutils/gas/config/tc-tic6x.c:1599: error: missing initializer
/home/jbglaw/repos/binutils/gas/config/tc-tic6x.c:1599: error: (near initialization for ‘second_reg.num’)
make[3]: *** [tc-tic6x.o] Error 1

1109 /* A register or register pair read by the assembler.  */
1110 typedef struct
1111 {
1112   /* The side the register is on (1 or 2).  */
1113   unsigned int side;
1114   /* The register number (0 to 31).  */
1115   unsigned int num;
1116 } tic6x_register;
[...]
1599       tic6x_register first_reg, second_reg = { 0 };


Thus is suggest:

2013-10-14  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

gas/
	* config/tc-score.c (s3_do_macro_bcmp): Don't initialize variable.
	* config/tc-tic6x.c (tic6x_parse_operand): Ditto.
	
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index 2bb3fbe..822b9cf 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -4489,7 +4489,7 @@ s3_do_macro_bcmp (char *str)
   char* ptemp;
   int i = 0;
   struct s3_score_it inst_expand[2];
-  struct s3_score_it inst_main = { 0 };
+  struct s3_score_it inst_main;
 
   memset (inst_expand, 0, sizeof inst_expand);
   s3_skip_whitespace (str);
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index fda9cd3..81f33f4 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -1596,7 +1596,7 @@ tic6x_parse_operand (char **p, tic6x_operand *op, unsigned int op_forms,
   /* See if this looks like a register or register pair.  */
   if (!operand_parsed && (op_forms & (TIC6X_OP_REG | TIC6X_OP_REGPAIR)))
     {
-      tic6x_register first_reg, second_reg = { 0 };
+      tic6x_register first_reg, second_reg;
       bfd_boolean reg_ok;
       char *rq = q;
 


MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
 Signature of:                    Arroganz verkürzt fruchtlose Gespräche.
 the second  :                                   -- Jan-Benedict Glaw

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ping] [buildrobot][PATCH]: gas/config/tc-score.c:4492: error: missing braces around initializer
  2013-10-14 19:20 [buildrobot][PATCH]: gas/config/tc-score.c:4492: error: missing braces around initializer Jan-Benedict Glaw
@ 2013-10-16 19:39 ` Jan-Benedict Glaw
  0 siblings, 0 replies; 2+ messages in thread
From: Jan-Benedict Glaw @ 2013-10-16 19:39 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

On Mon, 2013-10-14 21:20:17 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> I think this is another fallout of the cppcheck silencing:
[...]

Ping.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
 Signature of:                    Don't believe in miracles: Rely on them!
 the second  :

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-16 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-14 19:20 [buildrobot][PATCH]: gas/config/tc-score.c:4492: error: missing braces around initializer Jan-Benedict Glaw
2013-10-16 19:39 ` [ping] " Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).