Mail Archives: djgpp/2003/07/08/16:20:02

Date: Tue, 8 Jul 2003 21:52:09 +0200 (MEST)
From: ahelm AT gmx DOT net
To: djgpp AT delorie DOT com
MIME-Version: 1.0
Subject: nested functions
X-Priority: 3 (Normal)
X-Authenticated-Sender: #0003579562 AT gmx DOT net
X-Authenticated-IP: []
Message-ID: <>
X-Mailer: WWW-Mail 1.6 (Global Message Exchange)
X-Flags: 0001


Sorry to bother you here in the DJGPP mailing list. This might be slightly
but I know there are a couple of bright guys out there who might just know
this... ;-)

I try to figure out _why_ the following code compiles with DJGPP:

int abc(void)
  int x = 0;
  int y = 2;

  int def(int r)
    int x = 1;
    return r + x;

  return def(x) + def(y);

int main(void)
  return abc();

Could somebody enlighten me whether nested functions are a GCC or DJGPP
extension or whether they are actually part of the C standard.
A reference to the relevant chapter in the standard would be most
I've been digging through the standard(s), but I'm still not sure whether or
not the
above should work.

Thanks for your help,


+++ GMX - Mail, Messaging & more +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!

- Raw text -

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