Which C compiler is best to use?(TO Martin Ambuhl for his suggestions)

R

rahul8143

Hello sir,
First sorry if seen this as again posted due to network
problem. Thanks for pointing me that void main() is wrong to use
*****************************************************************************
> void main()

^^^^
Why do so many people post without
a) following the newsgroup
b) checking the FAQ
or even
c) learning the first thing about C from even the most basic textbook?

It is impossible to take seriously a question from someone who could
screw up something so basic.

^^^^
You're dead already.
*****************************************************************************
^^^^
How can anyone have the gall to post three questions all with the same
basic error?
**************************************************************************

Above are all your 3 posts. Now what i want to ask if you mean to say
if
such above mistake is making me dead in C then first of all tell me
which
compiler are you using for C programming?
I have tested my code with
Microsoft VC++ 6.0
Then it seems Microsoft compiler is wrong to use then why not you write
a
email to Microsoft that add some patch or show warning about not to use
void main but use int main.

Also as per your suggestion i check and found on linux GCC is the
compiler that shows
warning only and allow to execute code. but where can i get graphical
frontend for gcc compiler for WINDOWS OS?

It seems you have more information so please kindly reply me and
please
you only give me link for downloading that Graphical Frontend GCC
compiler.
Thanks for your help.
 
R

rahul8143

Hello sir,
First sorry if seen this as again posted due to network
problem. Thanks for pointing me that void main() is wrong to use
*****************************************************************************

^^^^
Why do so many people post without
a) following the newsgroup
b) checking the FAQ
or even
c) learning the first thing about C from even the most basic textbook?

It is impossible to take seriously a question from someone who could
screw up something so basic.

^^^^
You're dead already.
*****************************************************************************
^^^^
How can anyone have the gall to post three questions all with the same
basic error?
**************************************************************************

Above are all your 3 posts. Now what i want to ask if you mean to say
if
such above mistake is making me dead in C then first of all tell me
which
compiler are you using for C programming?
I have tested my code with
Microsoft VC++ 6.0
Then it seems Microsoft compiler is wrong to use then why not you write
a
email to Microsoft that add some patch or show warning about not to use
void main but use int main.

Also as per your suggestion i check and found on linux GCC is the
compiler that shows
warning only and allow to execute code. but where can i get graphical
frontend for gcc compiler for WINDOWS OS?

It seems you have more information so please kindly reply me and
please
you only give me link for downloading that Graphical Frontend GCC
compiler.
Thanks for your help.

ok i found one compiler on http://www.c-frame.com/ is it ok with you
to use me that as perfect compiler that follows all C syntax rules
 
B

Ben Pfaff

(e-mail address removed) writes:

[...regarding void main()...]
Now what i want to ask if you mean to say if such above mistake
is making me dead in C then first of all tell me which compiler
are you using for C programming? I have tested my code with
Microsoft VC++ 6.0

The compiler in use is irrelevant. The only portable return type
for main() is int. Some compilers and runtime systems will
accept other types. This doesn't mean that the code is correct,
only that it works on some systems.
Then it seems Microsoft compiler is wrong to use then why not
you write a email to Microsoft that add some patch or show
warning about not to use void main but use int main.

Microsoft knows. They don't care.
Also as per your suggestion i check and found on linux GCC is
the compiler that shows warning only and allow to execute
code. but where can i get graphical frontend for gcc compiler
for WINDOWS OS?

It would seem that this is your problem, not ours.
 
N

Netocrat

^^^^
It is impossible to take seriously a question from someone who could
screw up something so basic.
Above are all your [Martin Ambuhl's] 3 posts. Now what i want to ask ...

Before you ask any more questions, perhaps you would answer Martin's,
which rephrased are:

Do you regularly read the posts in this newsgroup?
Do you know what a FAQ is?
If so, do you know where to find the FAQ for this newsgroup?
If so, have you read it?
Do you have a basic C textbook and have you read it?
where can i get graphical
frontend for gcc compiler for WINDOWS OS?

Hunt around the software sites on the web. There are plenty to choose
from. I don't know about the availability of graphical debuggers but I'd
be surprised if you couldn't find something.
 
R

rahul8143

Netocrat said:
^^^^
It is impossible to take seriously a question from someone who could
screw up something so basic.
Above are all your [Martin Ambuhl's] 3 posts. Now what i want to ask ...

Before you ask any more questions, perhaps you would answer Martin's,
which rephrased are:

Do you regularly read the posts in this newsgroup? yes
Do you know what a FAQ is? yes
If so, do you know where to find the FAQ for this newsgroup? yes
If so, have you read it? not completely.
Do you have a basic C textbook and have you read it? yes
where can i get graphical
frontend for gcc compiler for WINDOWS OS?

Hunt around the software sites on the web. There are plenty to choose
from. I don't know about the availability of graphical debuggers but I'd
be surprised if you couldn't find something.
there's no problem to search ans i already did it (check my
last post)but i require some authetication from members of this group
for that software otherwise if i got something similar to Microsoft
VC++ then i will again continuing with my mistakes in writing programs.
 
R

rahul8143

Ben said:
(e-mail address removed) writes:

[...regarding void main()...]
Now what i want to ask if you mean to say if such above mistake
is making me dead in C then first of all tell me which compiler
are you using for C programming? I have tested my code with
Microsoft VC++ 6.0

The compiler in use is irrelevant. The only portable return type
for main() is int. Some compilers and runtime systems will
accept other types. This doesn't mean that the code is correct,
only that it works on some systems.
Then it seems Microsoft compiler is wrong to use then why not
you write a email to Microsoft that add some patch or show
warning about not to use void main but use int main.

Microsoft knows. They don't care.
Also as per your suggestion i check and found on linux GCC is
the compiler that shows warning only and allow to execute
code. but where can i get graphical frontend for gcc compiler
for WINDOWS OS?

It would seem that this is your problem, not ours.
ok its my problem that i am not able to find a good compiler that
meets C standards. I thought may be members of this group help me to
use correct compiler on windows other than usual one Microsoft VC++ 6.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p\
);}return 0;}
 
B

Ben Pfaff

Ben said:
(e-mail address removed) writes:

[...regarding void main()...]
Now what i want to ask if you mean to say if such above mistake
is making me dead in C then first of all tell me which compiler
are you using for C programming? I have tested my code with
Microsoft VC++ 6.0

The compiler in use is irrelevant. The only portable return type
for main() is int. Some compilers and runtime systems will
accept other types. This doesn't mean that the code is correct,
only that it works on some systems.
[...]
It would seem that this is your problem, not ours.
ok its my problem that i am not able to find a good compiler that
meets C standards. I thought may be members of this group help me to
use correct compiler on windows other than usual one Microsoft VC++ 6.

You seem to be confused. Defining main() to return `void' is
undefined behavior. This means that a compiler may treat it any
way, and it is not required to diagnose it. Thus, the Microsoft
compiler's behavior is standard conforming. The GCC behavior is
simply more helpful.
 
N

Netocrat


Perhaps you missed the thread(s) that have occurred within the last month
or so in which it was discussed that the only portable return type for
main is int. You also have ignored Keith Thompson's direct advice to you
that main should return int in an earlier thread.

I'm trying to give you the benefit of the doubt.
not completely.

Check out questions 11.12, 11.13 and 11.15.

Most of the questions you've posted recently would have been easily
answered by reading the FAQ, your text book or following the group.
i require some authetication from members of this group for that
software otherwise if i got something similar to Microsoft VC++ then i
will again continuing with my mistakes in writing programs.

As far as I'm aware VC++ is ANSI compliant, or can be run in such a mode.
The point is that you can't rely on your compiler to tell you whether code
you write is standards-compliant. Sometimes it can't know or isn't
required to diagnose it. It's up to you to know.
 
R

Raymond Martineau

(e-mail address removed) writes:

[...regarding void main()...]
Then it seems Microsoft compiler is wrong to use then why not
you write a email to Microsoft that add some patch or show
warning about not to use void main but use int main.

Microsoft knows. They don't care.

Actually, Microsoft has the following prototype in crt0.c (startup
routines), which is called function in __crt0():

int __cdecl main(int, char **, char **); /*generated by compiler*/

Allowing the user that kind of access to the startup libraries makes it
pointless to force main() to have a specific return value or function
prototype. Even though there is no ultimate purpose to change tho
function declaration, the user still has the option to make his own
personal start function.

Having main declared incorrectly should be as issue between the programmer
and startup libraries - not between the programmer and the compiler. It
should be no different than prototyping a function as returning a pointer
when it really returns a struct.
 
K

Keith Thompson

Having main declared incorrectly should be as issue between the programmer
and startup libraries - not between the programmer and the compiler. It
should be no different than prototyping a function as returning a pointer
when it really returns a struct.

Having main declared incorrectly should be an issue between the
programmer and the implementation. Though the compiler is not
obligated to warn about void main(), it would be helpful if it did so
(especially to those of us here who have to deal with the resulting
bad code).
 
E

Emmanuel Delahaye

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top