[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

doubt in C reg. Local function definition

From: Aravind Perumal
Subject: doubt in C reg. Local function definition
Date: Wed, 19 May 2004 12:45:36 +0530


   can any of u let me know Y gcc compiler not giving warning if i  define a function with in a function.


    #include <stdio.h>

    int main()   {

                       int x=10;

                      int  show() {

                     int w; 

                     printf ( " inside function \n");

                     return 55;


         printf("   ret value =>  %d  ", show() );

         return 0;


  its giving  the expected result.

  is local function allowed ?? ( i am sure it is not  allowed)

  then  Y   its not giving any warning ?

 i compiled in gcc with  -Wall options.

  i compiled in different compilers .

 VC ++ , BC++    --->    giving  warning   ( local function illegal )

  gcc , cc , g++    --->  not giving any warning (  getting result )

   and i checked after preprocessing &  assembling  (  it is coforming show  as a function type )

  is there any problem in gcc compiler ?  (  i checked in different machines )


could u clear my doubt?





This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is intended for the addressee only. Any unauthorized disclosure, use, dissemination, copying, or distribution of this message or any of its attachments or the information contained in this e-mail, or the taking of any action based on it, is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail and delete this message.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]