delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/04/08/13:42:19

From: rdparker AT butlermfg DOT org (Parker, Ron)
Subject: RE: Committed some warnings-removing changes
8 Apr 1998 13:42:19 -0700 :
Message-ID: <c=US%a=_%p=Butler_Manufactu%l=BUILDINGS/BLDGSHUB/0009397E.cygnus.cygwin32.developers@nttwr2.tower.bldgs.butlermfg.org>
Mime-Version: 1.0
To: Geoffrey Noer <noer AT cygnus DOT com>
Cc: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

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

Yes. Each struct or array which is statically initialized in C/C++
should have brackets around it.  This includes nested structs and
arrays.  For example:
	static struct {
		int vk;
		char *val[4];
	} keytable[] = {
		{ VK_LEFT,    { "\033[D",	NULL,		NULL,		NULL } },
		{ 0,          { "",		NULL,		NULL,		NULL } }
	};

> 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?

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

> 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

This is refering to the static rethere. What is happening is that you
are poping values from the stack into rethere, but nothing is reading
the contents of rethere.

I believe you can accomplish the same thing by deleting the definition
of rethere and changing:
      "popl	_rethere\n"
      "popl	_rethere\n"
      "popl	_rethere\n"
      "ret");
to:
	"ret 12");
This should pop the twelve-bytes from the stack before returning from
the function.  

Also, the stack only needs probed every 4KB not every 2KB and I believe
no stackprobe should be needed at all.  If you expect this stack space
to be accessed, it should be probed out by the fucntion that accesses
it, either the sigproc or set_process_mask.

- Raw text -


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