* Compiling functions without return type.
@ 2000-01-27 12:07 amol jakatdar
2000-01-27 15:46 ` llewelly
2000-04-01 0:00 ` amol jakatdar
0 siblings, 2 replies; 4+ messages in thread
From: amol jakatdar @ 2000-01-27 12:07 UTC (permalink / raw)
To: Gcc Help
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.
Amol
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiling functions without return type.
2000-01-27 12:07 Compiling functions without return type amol jakatdar
@ 2000-01-27 15:46 ` llewelly
2000-04-01 0:00 ` llewelly
2000-04-01 0:00 ` amol jakatdar
1 sibling, 1 reply; 4+ messages in thread
From: llewelly @ 2000-01-27 15:46 UTC (permalink / raw)
To: amol jakatdar; +Cc: Gcc Help
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiling functions without return type.
2000-01-27 15:46 ` llewelly
@ 2000-04-01 0:00 ` llewelly
0 siblings, 0 replies; 4+ messages in thread
From: llewelly @ 2000-04-01 0:00 UTC (permalink / raw)
To: amol jakatdar; +Cc: Gcc Help
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Compiling functions without return type.
2000-01-27 12:07 Compiling functions without return type amol jakatdar
2000-01-27 15:46 ` llewelly
@ 2000-04-01 0:00 ` amol jakatdar
1 sibling, 0 replies; 4+ messages in thread
From: amol jakatdar @ 2000-04-01 0:00 UTC (permalink / raw)
To: Gcc Help
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.
Amol
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-04-01 0:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-27 12:07 Compiling functions without return type amol jakatdar
2000-01-27 15:46 ` llewelly
2000-04-01 0:00 ` llewelly
2000-04-01 0:00 ` amol jakatdar
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).