🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.os.linux.ubuntu
Article #123

Re: where to put custom headers

#123
From: Keith Thompson
Date: Wed, 27 Jan 2010 05:04
40 lines
2523 bytes
frank <frank@example.invalid> writes:
[...]
> Given this intention, would you say this is an appropriate compile
> command line:
>
> dan@dan-desktop:~/source$ gcc -D_GNU_SOURCE -Wall -Wextra rd3.c -o out
>
> ?  I'm not sure where I picked up -Wall and -Wextra.  Are they both
> still useful?

I'm not going to comment on the -D_GNU_SOURCE portion of this (due to
a lack of expertise), but I will say something about the "-o".

When compiling and linking a source file "foo.c" to create an
executable, the convention is to call the executable "foo":

    gcc ... foo.c -o foo

(It might be something like "foo.exe" on non-Unix-like systems.)

When compiling a source file "foo.c" to create an object file without
linking, the convention is to call the object file "foo.o":

    gcc -c ... foo.c -o foo.o

or just:

    gcc -c ... foo.c

since "foo.o" is the default output name.

You are of course free to call your output files whatever you like,
but I suggest following these conventions unless you have a good
reason not to.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
Technical Details
Message-ID: <lny6jkw32k.fsf@nuthaus.mib.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
References: <7ror8bFjn6U1@mid.individual.net> <4b578c9a$0$18138$a9266ab1@news.buzzardnews.com> <7rshd7Fa3vU1@mid.individual.net> <hjbk9j$s2d$1@speranza.aioe.org> <7s9u9uF6kkU1@mid.individual.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1200bcf240,4af9266eb6a90621
X-Google-Attributes: gid1200bcf240,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <kst-u@mib.org>
Newsgroups: alt.os.linux.ubuntu,gnu.gcc.help
Subject: Re: where to put custom headers
Date: Tue, 26 Jan 2010 21:04:51 -0800
Organization: None to speak of
Lines: 40
Message-ID: <lny6jkw32k.fsf@nuthaus.mib.org>
References: <7ror8bFjn6U1@mid.individual.net> <4b578c9a$0$18138$a9266ab1@news.buzzardnews.com> <7rshd7Fa3vU1@mid.individual.net> <hjbk9j$s2d$1@speranza.aioe.org> <7s9u9uF6kkU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 27 Jan 2010 05:08:26 +0000 (UTC)
Injection-Info: news.motzarella.org; posting-host="f6Njqws0KA42eUrAB2+3Cw";
 logging-data="18681"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pMlhzDpQoVa58JpvZ2uQK"
User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:phvyPXUB1Eb+fiGhqIjJrRC/Ylo=
 sha1:3qr8eQxK5d6FroLkbMQFwHZyy68=