public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Static nested functions
@ 2004-12-01  7:12 James A. Morrison
  2004-12-01  7:36 ` Zack Weinberg
  0 siblings, 1 reply; 6+ messages in thread
From: James A. Morrison @ 2004-12-01  7:12 UTC (permalink / raw)
  To: gcc


 Hi,

  I'm looking at 18596 again because my fix didn't do what I expected (it does
nothing).  Anyway, we have in gcc.dg/funcdec-storage-1.c the following
void
flarm(void)
{
  static void foo();  /* { dg-error "invalid storage class" } */

  foo();
}

  Should foo () be considered a static function at the file level or a nested
function at the function level.  If we consider foo() to be at the file level
then we can be done with this function.  If we consider foo() to be a nested
function we then discover that foo() is undefined at the end of the function
and run into PR17807.  The nice part about considering foo() to be a nested
function is that in c-decl.c:grokdeclarator() we can turn the storage class of
foo() from static to auto which fixes the ICE in 18596.  However we look at
this we are in an error case, but we should do something sane.

-- 
Thanks,
Jim

http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim

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

end of thread, other threads:[~2004-12-02  1:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01  7:12 Static nested functions James A. Morrison
2004-12-01  7:36 ` Zack Weinberg
2004-12-01 11:05   ` Joseph S. Myers
2004-12-01 17:38     ` Zack Weinberg
2004-12-01 17:43       ` Joseph S. Myers
2004-12-02  1:22         ` James A. Morrison

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).