Re: Linux compiling
From: Paul F. Johnson (paul_at_all-the-johnsons.co.uk)
Date: 12/03/04
- Next message: Chris \( Val \): "Re: showpos problem."
- Previous message: Anthony Borla: "Re: Convert short C code into C++"
- In reply to: Alwyn: "Re: Linux compiling"
- Next in thread: Chris \( Val \): "Re: Linux compiling"
- Reply: Chris \( Val \): "Re: Linux compiling"
- Reply: Alwyn: "Re: Linux compiling"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 03 Dec 2004 12:46:56 +0000
Hi,
Alwyn wrote:
> On Thu, 02 Dec 2004 21:04:40 -0600, Jack Klein wrote:
>>There are quite a few things that are popular among the careless and
>>ignorant. Do you think we should encourage carelessness and
>>ignorance?
>
> What is it about Usenet that makes people get so worked up over such
> trivialities as the correct return type of a C function and make
> violent personal attacks on those whom they perceive to be in disagreement
> with them? Why do programming languages generate the kind of emotion among
> the geeky that one associates with religion and politics in normal people?
The problem is many fold.
For a start, void main has *never* been correct and as Jack has said, it
really is undefined what happens. Are you seriously suggesting that
someone trying to learn should take the Schildt approach of "it's wrong,
but what they hey, it compiles doens't it!" - we all know how many
problems that causes down the lines.
While a specific version of a compiler may accept void main, that
doesn't make it right either. MS compilers for a long time used to
change int main to void main if a return was omitted instead of issuing
a warning - so from slightly broken to completely broken happened. Not
good by any stretch of the imagination - worse than that, to save time,
college lecturers would actually *teach* void main as being correct so
they didn't need to answer the questions about what the warning or
message was!
main() is also probably the single most function as it's the first one
which is executed and unless there is an abnormal abort, the final one
exectuted to return control. Other applications rely on a return value
from main. If they don't get one due to someone using a void return type
(or for that matter, any other non-int return type), then the process
stops and that's it - you have other programs not working due to that
problem.
As to the personal attack, I think you're over reacting. You've been
around here long enough to realise that if you give such advice that
it's not a biggy if you give main the wrong return type that you will
get jumped on as it's such a fundamental mistake. It is a biggy and to
say it's not really does you, and this group, a disservice.
I hope that explains why Jack said what he did.
TTFN
Paul
- Next message: Chris \( Val \): "Re: showpos problem."
- Previous message: Anthony Borla: "Re: Convert short C code into C++"
- In reply to: Alwyn: "Re: Linux compiling"
- Next in thread: Chris \( Val \): "Re: Linux compiling"
- Reply: Chris \( Val \): "Re: Linux compiling"
- Reply: Alwyn: "Re: Linux compiling"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|