This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling functions without return type.
- To: amol jakatdar <ajakatda at cs dot odu dot edu>
- Subject: Re: Compiling functions without return type.
- From: llewelly at 198 dot dsl dot xmission dot com
- Date: 27 Jan 2000 16:45:17 -0700
- Cc: Gcc Help <gcc-help at gcc dot gnu dot org>
- References: <Pine.SOL.4.05.10001271455270.7658-100000@rose.cs.odu.edu>
amol jakatdar <ajakatda@cs.odu.edu> writes:
> Hi,
>
> is there a way to compile following code using g++:
>
> #include <stdio.h>
>
> 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.