This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: First basic program


then its a padronization of GCC to declare return type of main a int

I will read them!

thanks! 

til more

Em Dom, 2003-02-23 às 17:56, bjorn rohde jensen escreveu:
> Hi there,
> 
>   Opinions differ, but it has always been my understanding
> that main should be declared as returning int:) gcc seems
> to think so too.
>   The reason, you get a file by the name "a.out", is simply,
> that you have not told gcc to call it anything, so it uses
> the traditional default. You should be aware, that creating
> an executable conceptually involves 2 steps; the generation
> of a number of object files from their source .c files, and
> secondly the linking of the object files with various libraries
> to form the executable. In your case, gcc does both.
>   Some commonly used options to gcc are; -ansi -pedantic -Wall
> -O3, -c and -o. The first 3 are to get gcc to check/warn about
> a lot of possible mistakes, which might technically be legal,
> but unlikely to be the intention and to reject programs using
> platform specific extensions for better portability. The others
> and plenty more, you can read all about in the nice man pages
> for gcc:)
> 
> Yours sincerely,
> 
> Bjorn
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]