public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/41624]  New: RFE: -fno-nested-functions
@ 2009-10-07 18:55 ajax at redhat dot com
  2009-10-07 19:00 ` [Bug c/41624] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ajax at redhat dot com @ 2009-10-07 18:55 UTC (permalink / raw)
  To: gcc-bugs

Nested functions in C are a serious misfeature, for any number of reasons (some
of which are even in the manual).  They should be something a project should be
able to ban the use of at the language level, without forcing a switch to
strict non-gnu mode.

Also, unlike most g89 language features, they seriously impede the ability of
the parser to tell you where syntax errors occur.  As it is, a missing }
doesn't get noticed until the end of the compilation unit; non-nested-function
dialects of C can fail at exactly the nested function declaration.


-- 
           Summary: RFE: -fno-nested-functions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ajax at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41624


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

* [Bug c/41624] RFE: -fno-nested-functions
  2009-10-07 18:55 [Bug c/41624] New: RFE: -fno-nested-functions ajax at redhat dot com
@ 2009-10-07 19:00 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-10-07 19:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-10-07 19:00 -------
I don't think they are a misfeature at all.  Ada for an example actually
requires nested functions even with the reasons we mention in the manual, that
is trampolines and such.  Fortran also has nested functions.

Now non local gotos are in my thoughts a more misfeature than nested functions.

Also some ABIs don't require a trampoline at all.  The PowerOpen/AIX/PowerPC64
Linux ABI does not require a trampoline and creates a function descriptor with
the needed chain pointer.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41624


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

end of thread, other threads:[~2009-10-07 19:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-07 18:55 [Bug c/41624] New: RFE: -fno-nested-functions ajax at redhat dot com
2009-10-07 19:00 ` [Bug c/41624] " pinskia at gcc dot gnu dot org

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