[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Motivation for renaming to and its effect

From: Steffen Dettmer
Subject: Re: Motivation for renaming to and its effect?
Date: Tue, 9 Mar 2010 10:16:52 +0100

On Mon, Mar 8, 2010 at 6:27 PM, Peter Breitenlohner <address@hidden> wrote:
> > > Everything else is philosophy/ideology.

I thought concluding content from file name was MS-DOS style
(because MS-DOS had no /bin/file and big use of pipes), but it
seems several un*x tools also per default assume content based on
files names, which in practice makes things easier to use, such
as in case of compiling and linking .c, .a and .o.

> > Well, I presume your C-sources are named *.jpg?
> Certainly not

I doubt that next C language specification will attempt to rename
the extension of `.c' files to let's say `.isoc', but even if so, I
would expect major compilers would support `.c' too, as
fortunately autoconf is doing.

   (please note, I never said calling `' would be
   wrong or bad or anything. It is fine!
   I just tried to understand the implications and potential
   issues with using an old deprecated name to be able to
   evaluate those disadvantages against the others. As soon and
   they overweight, we'll rename `' files.).

C-sources named `*.jpg' won't work with major compilers:

address@hidden # gcc c.jpg
c.jpg: file not recognized: File format not recognized
collect2: ld returned 1 exit status

address@hidden # tcc c.jpg
Error: type of 'c.jpg' unknown (file ignored)

address@hidden # CL.EXE c.jpg
Befehlszeilenwarnung D4024 : Typ der Quelldatei 'c.jpg' nicht erkannt,
Objektdatei wird angenommen
c.jpg : fatal error LNK1136: Ungueltige oder beschaedigte Datei

address@hidden:/local/tmp/steffen_exp/tsade_sys.all # file c.jpg
c.jpg: ASCII C program text

but with gcc there is `-x' (and similarily, CL.EXE has `/TC'):

address@hidden # gcc -x c c.jpg
address@hidden # ./a.out
Hello, world

address@hidden # echo 'print "Hello, world!\n";' > perl.jpg
address@hidden # perl perl.jpg
Hello, world!

BTW, a.out also is a backward-compatible example:
address@hidden # file a.out
a.out: ELF 32-bit LSB executable [...]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]