From mboxrd@z Thu Jan 1 00:00:00 1970 From: llewelly@198.dsl.xmission.com To: amol jakatdar Cc: Gcc Help Subject: Re: Compiling functions without return type. Date: Thu, 27 Jan 2000 15:46:00 -0000 Message-id: References: X-SW-Source: 2000-01/msg00179.html amol jakatdar writes: > Hi, > > is there a way to compile following code using g++: > > #include > > f(); // Function defination w/o return type > > int main(int argc, char *argv[]) > { > f(); > return 0; > } > > f() > { > printf("%d",1); > return 0; > } > > I know this is against ANSI standards, but I have some header files, > defining functions like this. > Try -fpermissive . I know a few people who have used -fpermissive to build stuff like gtk on solaris (which has many many lines of non-compliant code like the above in its old X11 headers) . Of course, it is best to fix the code, since the C99 (new ANSI C standard) makes k & r style function defs errors. From mboxrd@z Thu Jan 1 00:00:00 1970 From: llewelly@198.dsl.xmission.com To: amol jakatdar Cc: Gcc Help Subject: Re: Compiling functions without return type. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: References: X-SW-Source: 2000-q1/msg00179.html Message-ID: <20000401000000.NJvAOWr-Z4cj9VX4NuOHxy7yvuN0ffi9cVP-uDMzOZg@z> amol jakatdar writes: > Hi, > > is there a way to compile following code using g++: > > #include > > f(); // Function defination w/o return type > > int main(int argc, char *argv[]) > { > f(); > return 0; > } > > f() > { > printf("%d",1); > return 0; > } > > I know this is against ANSI standards, but I have some header files, > defining functions like this. > Try -fpermissive . I know a few people who have used -fpermissive to build stuff like gtk on solaris (which has many many lines of non-compliant code like the above in its old X11 headers) . Of course, it is best to fix the code, since the C99 (new ANSI C standard) makes k & r style function defs errors.