delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/04/08/08:41:23

From: ian AT cygnus DOT com (Ian Lance Taylor)
Subject: Re: Committed some warnings-removing changes
8 Apr 1998 08:41:23 -0700 :
Message-ID: <199804081516.LAA23876.cygnus.cygwin32.developers@subrogation.cygnus.com>
References: <199804081042 DOT DAA28956 AT rtl DOT cygnus DOT com>
To: noer AT cygnus DOT com
Cc: cygwin32-developers AT cygnus DOT com, noer AT cygnus DOT com

   From: Geoffrey Noer <noer AT cygnus DOT com>
   Date: Wed, 8 Apr 1998 03:42:23 -0700 (PDT)

   1) Anyone know how to fix the following message followed by many more
   of the same?

	   /home/noer/src/devo/comp-tools/devo/winsup/console.cc:1220: warning:
	   aggregate has a partly bracketed initializer

   I understand what the warning means in this context -- we aren't
   explicit enough about how the chars are assigned to the char[4]
   element of the struct.  But I'm not sure how to fix it other than by
   stopping statically initializing the struct.

Write the lines as

            VK_LEFT,   { "\033[D",	NULL,		NULL,		NULL },

To quote the gcc manual, this is what the warning means:

        * An aggregate has a partly bracketed initializer.  For
          example, the following code would evoke such a warning,
          because braces are missing around the initializer for `x.h':

               struct s { int f, g; };
               struct t { struct s h; int i; };
               struct t x = { 1, 2, 3 };

   2) In tty.cc, gcc claims that class tty * ttyp is an unused
   variable in fhandler_tty_slave::close().  What needs to change here,
   if anything?

The line in question is:

  tty *ttyp = s->t.gettty (ttynum);

Since gettty, an inline function in tty.h, has no side effects, you
should simply remove this line entirely.  All it does is set the
variable ttyp which is then never used.

   3) In exceptions.cc,

	   /home/noer/src/devo/comp-tools/devo/winsup/exceptions.cc: At top
	   level:
	   /home/noer/src/devo/comp-tools/devo/winsup/exceptions.cc:370: warning:
	   `unsigned int rethere' defined but not used

   Is this really the case?  Or is _rethere that's mentioned in the asm
   section refering to the global rethere?

It's the global variable.  However, this is a slightly bogus way to do
things.  Instead, you should use the gcc extended asm feature to pass
rethere in as an argument; see the gcc manual.  Before making any such
change, you should run gcc -S to get the generated assembler, and
confirm that it does not change when you make your change.

Ian

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019