Linux-Development-Sys Digest #852, Volume #7 Sat, 13 May 00 17:13:15 EDT
Contents:
Re: ANSI C & void main() ("Frank")
Re: Linux drivers for DVD drives? (Sean Godsell)
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() (Ulrich Weigand)
Re: ANSI C & void main() (Mike McDonald)
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() (Joe Pfeiffer)
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() ("Frank")
Re: Linux drivers for DVD drives? (Stefan Homburg)
Re: 100 Mb thernet PCI on a 486 DX2 66MHz? (Mark Hahn)
Re: ANSI C & void main() (Erik Max Francis)
Re: ANSI C & void main() (Erik Max Francis)
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() (Erik Max Francis)
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() ("Frank")
Re: ANSI C & void main() (Chris J/#6)
Re: ANSI C & void main() (Ulrich Weigand)
Re: ANSI C & void main() (Erik Max Francis)
Re: ANSI C & void main() (Erik Max Francis)
Re: ANSI C & void main() (Erik Max Francis)
----------------------------------------------------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 14:18:23 GMT
Mark Graybill <QaTS4.59706$[EMAIL PROTECTED]>...
^
^ Tell me when the original standard was published. (Hint: 16 >> 4; 144 >> 4;
^ 128 >> 4; 144 >> 4;)
^
^ Where you programming in C then?
I had to go back through my old code archives to figure out when I began
writing in C. I have an older system in storage that may have some older C
code but the oldest I can find on this system is one which I marked as
copyright 1989. It start's out:
main(argc, argv)
char *argv[];
int argc;
{
Is this now referred to as K&R C?
My old books are also in storage so I can't check them, but I suspect that the
return type was 'int' by default (but so is 'void main()'). Whatever K&R
permitted at the time was a defacto standard since there were no other flavors
of C.
Frank Westlake
------------------------------
From: Sean Godsell <[EMAIL PROTECTED]>
Subject: Re: Linux drivers for DVD drives?
Date: Sat, 13 May 2000 14:30:38 GMT
Hello Jay,
I don't have a DVD rewritable myselft, but from what I have read, you
can use cdrecord for DVD's. I use cdrecord for plain old CD/RW's. The
docs that come with cdrecord mention that it will work for DVD's as
well. You might want to check the site first to see if your DVD is
supported.
http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
Good Luck, and have Fun!!!
Sean Godsell
[EMAIL PROTECTED]
Jay Braun wrote:
> Are there drivers for rewritable DVD drives on Linux?
>
> Thanks,
> Jay
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 14:42:02 GMT
Horst von Brand <[EMAIL PROTECTED]>...
^ On Fri, 12 May 2000 12:55:12 GMT, Mark Graybill <[EMAIL PROTECTED]> wrote:
^
^ >When C first came out, it allowed for void main(). I'm sure Dennis Ritchie
^ >has an original copy in his archives. I will see if he will consult it.
^
^ Impossible. Original (K&R C) didn't have void at all.
========================================================
/*
HEADER: CUG000.00;
TITLE: Compare Text Files;
DATE: 05/17/1987;
DESCRIPTION: "Best version of DIFF (file comparator) from Jan '86
issue of Software Practice and Experience.";
VERSION: 1.1;
KEYWORDS: File Comparator, File Compare, File Comparison, File
Comparison Utility;
FILENAME: FCOMP.C;
SEE-ALSO: DIFF;
COMPILERS: vanilla;
AUTHORS: Chuck Allison;
*/
[...]
void exit();
void main(argc,argv)
int argc;
char *argv[];
{
========================================================
Obviously 'void' existed in 1986.
Frank Westlake
------------------------------
From: [EMAIL PROTECTED] (Ulrich Weigand)
Subject: Re: ANSI C & void main()
Date: 13 May 2000 16:53:26 +0200
"Mark Graybill" <[EMAIL PROTECTED]> writes:
>In the current C++ ANSI standard (ICO-IEC 14882) section 3.6.1, paragraph 2
>reads:
>"[... The main function] shall have a return type of type int, but otherwise
>its type is implementation-defined. [...]"
How does
>So, void main() IS allowable according to the current ANSI C++ standard.
follow from the above quote? ;-)
--
Dr. Ulrich Weigand
[EMAIL PROTECTED]
------------------------------
Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Mike McDonald)
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 15:17:48 GMT
In article <01bfbce6$1632ef40$0125250a@isldniwocl>,
"Frank" <[EMAIL PROTECTED]> writes:
> My old books are also in storage so I can't check them, but I suspect that the
> return type was 'int' by default (but so is 'void main()'). Whatever K&R
> permitted at the time was a defacto standard since there were no other flavors
> of C.
>
> Frank Westlake
Wrong, there were lots of C flavors around in the mid 80s. Some even had
void types. Most tried to be backwards compatible with K&R.
Mike McDonald
[EMAIL PROTECTED]
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 15:28:49 GMT
Ulrich Weigand <8fjq96$[EMAIL PROTECTED]>...
^ "Mark Graybill" <[EMAIL PROTECTED]> writes:
^
^ >In the current C++ ANSI standard (ICO-IEC 14882) section 3.6.1, paragraph 2
^ >reads:
^
^ >"[... The main function] shall have a return type of type int, but
otherwise
^ >its type is implementation-defined. [...]"
^
^ How does
^
^ >So, void main() IS allowable according to the current ANSI C++ standard.
^
^ follow from the above quote? ;-)
=======================================
"[... The main function] shall have a return type of type int...
This addresses the type of the returned object, not how main() is defined.
"...but otherwise its type is implementation-defined. [...]"
Not it's addressing the type of main().
It's saying that the type of main() shall not hard coded by any
implementation. Not even type 'int'. It's also saying that main() will always
return 'int'. From this, void main() is permitted but main() shall return
'int'.
void main(void)
{
printf("Hello world!\n");
}
This program meets those requirements because of the message portion you did
not quote:
^ ...and paragraph 5 reads:
^ "A return statement in main has the effect of leaving the main
^ function (destroying any objects with auto�matic storage duration)
^ and calling exit with the return value as the argument. If
^ control reaches the end of main without encountering a return
^ statement, the effect is that of executing return 0;"
Frank Westlake
------------------------------
From: Joe Pfeiffer <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: 13 May 2000 10:29:17 -0600
"Frank" <[EMAIL PROTECTED]> writes:
> ^
> ^ Impossible. Original (K&R C) didn't have void at all.
>
> Obviously 'void' existed in 1986.
1986 is hardly ``original'' C. IIRC, C dates back to about 1973 (I've
got a copy of the memo, but not with me...). Original C didn't have
enums. Original C used a single namespace for the fields of all
structs -- so if you had
struct foo1 {
int bar1;
} foobar1;
struct foo2 {
int bar2;
} foobar2;
i = foobar1.bar2;
would work just fine (which caused me *lots* of problems in 1978 when
I started writing C)!
Original C did not have void.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
VL 2000 Homepage: http://www.cs.orst.edu/~burnett/vl2000/
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 17:36:19 GMT
Joe Pfeiffer <[EMAIL PROTECTED]>...
^ "Frank" <[EMAIL PROTECTED]> writes:
^ >
^ > Obviously 'void' existed in 1986.
^
^ 1986 is hardly ``original'' C.
No but it is certainly earlier than the C++ standard, which was my point.
Frank Westlake
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 17:40:17 GMT
Mike McDonald <wmeT4.808$[EMAIL PROTECTED]>...
^ In article <01bfbce6$1632ef40$0125250a@isldniwocl>,
^ "Frank" <[EMAIL PROTECTED]> writes:
^
^ > My old books are also in storage so I can't check them, but I suspect that
the
^ > return type was 'int' by default (but so is 'void main()'). Whatever K&R
^ > permitted at the time was a defacto standard since there were no other
flavors
^ > of C.
^ >
^ > Frank Westlake
^
^ Wrong, there were lots of C flavors around in the mid 80s. Some even had
^ void types. Most tried to be backwards compatible with K&R.
^
My language was sloppy. K&R C became the defacto standard by default when it
was originated. The other flavors came into being sometime later but K&R was
still the defacto standard until ANSI defined it.
Frank Westlake
------------------------------
From: Stefan Homburg <[EMAIL PROTECTED]>
Subject: Re: Linux drivers for DVD drives?
Date: Sat, 13 May 2000 19:51:59 +0200
Jay Braun wrote:
> Are there drivers for rewritable DVD drives on Linux?
>
> Thanks,
> Jay
I am using Panosonic's DVD-RAM drive (5,2 gigabyte) and asked
myself the same question when I considered moving to linux. Curiously,
Panasonic provides a "linux driver", packed as a .zip file, but after
you
gunzip it, it only contains a textfile claiming that you do not need a
driver.
And this is actually true. My DVD-RAM is simply /dev/sdb. It is
treated as a harddisk by the system, with the exception that it cannot
be partitioned.
--
Prof. Dr. Stefan Homburg
Lehrstuhl �ffentliche Finanzen
Universit�t Hannover
K�nigsworther Platz 1
D-30167 Hannover
Tel.: (0049) 511-762-5633
Fax.: (0049) 511-762-5656
------------------------------
From: Mark Hahn <[EMAIL PROTECTED]>
Subject: Re: 100 Mb thernet PCI on a 486 DX2 66MHz?
Date: 13 May 2000 17:59:46 GMT
>> Can someone tell me if a old 486 Dx2 66Mhz PC can support a 100 Mb/s
>> ethernet PCI card ? or am I stuck with 10 Mb network if I want
if the motherboard has PCI, of course you can plug a 10/100 PCI card into it.
> Sure it can take it. Whether a DX2/66 can sustain 10MB/s?
it can certainly saturate 100bT (more like 12 MB/s, btw),
but it certainly depends on where the data's coming from.
> That'll depend on the card, but I guess it might be stressed
486/66's report around 20 MB/s on the Stream benchmark; then again,
the 486's FPU was pretty lame, so that might not be a good estimate
of available bandwidth.
> with the cheap ones (10MB/s was common for fast SCSI drives
> used in those days).
it was _not_ common for SCSI drives to sustain 10 MB/s in 486 days.
regards, mark hahn.
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 11:48:04 -0700
Frank wrote:
> main(argc, argv)
> char *argv[];
> int argc;
> {
>
> Is this now referred to as K&R C?
Yes.
> My old books are also in storage so I can't check them, but I suspect
> that the
> return type was 'int' by default ...
Return types (and even variable declarations) defaulting to int has been
around since traditional C.
> ... (but so is 'void main()').
Not sure what you meant here.
> Whatever K&R
> permitted at the time was a defacto standard since there were no other
> flavors
> of C.
"Flavors of C" is rather misleading here. Since there was no
officially-adopted standard, every C compiler implementor would pretty
much do their own thing. Most would use K&R as the de facto standard,
but it's not true that there as one and only one flavor of floating
around.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ They make it a desert and call it peace.
\__/ Tacitus
Kepler's laws / http://www.alcyone.com/max/physics/kepler/
A proof of Kepler's laws.
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 11:48:54 -0700
Frank wrote:
> So Linux doesn't support the struct return type. If I wrote an OS,
> Bigix, that
> fails to understand int returns and only supports struct returns then
> are you
> suggesting that I could never use C?
Using your OS would mean that no one could ever write an ANSI-compliant
C program.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ They make it a desert and call it peace.
\__/ Tacitus
Kepler's laws / http://www.alcyone.com/max/physics/kepler/
A proof of Kepler's laws.
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 18:58:17 GMT
Erik Max Francis <[EMAIL PROTECTED]>...
^ Frank wrote:
^ > ... (but so is 'void main()').
^
^ Not sure what you meant here.
I meant that 'void main()' returns an integer according to the standard cited
by Mark Graybill.
Frank
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 11:57:03 -0700
Frank wrote:
> "[... The main function] shall have a return type of type int...
>
> This addresses the type of the returned object, not how main() is
> defined.
The Standard states that the return type of main _must_ be int, and that
all implementations must allow it being called with no arguments or two
arguments (int argc, char *argv[]). It says that other definitions are
allowed, but are implementation defined.
That means that main must always return int. You quoted it yourself
just above.
> It's saying that the type of main() shall not hard coded by any
> implementation. Not even type 'int'.
Read it again. The phrase "shall have a return type of type int" is
very clear.
> It's also saying that main() will always
> return 'int'. From this, void main() is permitted but main() shall
> return
> 'int'.
That only does not make any sense, but is self-contradictory. The
second phrase means that other signatures are possible (but
implementation defined), and the first phrase says that they must all
return int (that means they must be declared to return int).
In other words, a compiler supporting a main that looks like
int main( /* some arbitrary sequence of arguments */ );
is legal, but implementation defined (i.e., it is not guaranteed to work
on other platforms, and must be documented by the compiler). A
prototype of
void main(void);
is illegal, because it does not return int.
> void main(void)
> {
> printf("Hello world!\n");
> }
>
> This program meets those requirements because of the message portion
> you did
> not quote:
>
> ^ ...and paragraph 5 reads:
>
> ^ "A return statement in main has the effect of leaving the main
> ^ function (destroying any objects with auto�matic storage duration)
> ^ and calling exit with the return value as the argument. If
> ^ control reaches the end of main without encountering a return
> ^ statement, the effect is that of executing return 0;"
This paragraph is predicated on what was said earlier, namely that main
must return int. Given that main must return int, C++ (but not C) makes
the provision that if control reaches the end of main, it is equivalent
to a return 0 statement.
That has no bearing and does not support what you're claiming. You're
claiming that void is a legal return type for main. That is not what
the Standard says; in fact it specifically disallows it. You're trying
some sort of weird word game and trying to pretend the Standard means
something else, but its meaing is quite clear.
void main(void);
is illegal.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ They make it a desert and call it peace.
\__/ Tacitus
Kepler's laws / http://www.alcyone.com/max/physics/kepler/
A proof of Kepler's laws.
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 19:15:41 GMT
Erik Max Francis <[EMAIL PROTECTED]>...
^ Frank wrote:
^
^ > If I wrote an OS, Bigix, that fails to understand
^ > int returns and only supports struct returns then
^ > are you suggesting that I could never use C?
^
^ Using your OS would mean that no one could ever write an
^ ANSI-compliant C program.
So then there is a problem with sticking to the standard in some instances.
The standard does allow for easily portable code but I have never needed
portable code in anything I've done. Portability is certainly essential in
many cases but it is also unnecessarily restrictive in others. If I wrote this
Bigix operating system the standard would eventually be changed to allow for
it, but in the interim no code will be written for it by anyone unable to look
beyond the standards. Those who do write code for it will be setting the
standard.
My point here is that the standard is a guide, not the law.
Frank
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 19:28:07 GMT
Erik Max Francis <[EMAIL PROTECTED]>...
^
^ You're claiming that void is a legal return type for main.
^ That is not what the Standard says; in fact it specifically
^ disallows it. You're trying some sort of weird word game
^ and trying to pretend the Standard means something else,
^ but its meaing is quite clear.
No, I am not playing a word game. I don't have a copy of any of the standards
(I've never used them) so I am relying on the portions quoted in this thread.
According to those quoted portions
void main(void)
{
printf("Hello World!\n");
/* return(0); implied */
}
is ANSI compliant code. If the standard specifically states elsewhere that, as
you say, "void main(void); is illegal," then I am wrong. But according to
what's been presented here I am correct.
Frank
------------------------------
From: [EMAIL PROTECTED] (Chris J/#6)
Subject: Re: ANSI C & void main()
Reply-To: [EMAIL PROTECTED]
Date: 13 May 2000 21:19:05 +0100
In article <01bfbd11$5df982f0$0125250a@ockkntlokp>,
Frank <[EMAIL PROTECTED]> wrote:
>Erik Max Francis <[EMAIL PROTECTED]>...
>^
>^ You're claiming that void is a legal return type for main.
>^ That is not what the Standard says; in fact it specifically
>^ disallows it. You're trying some sort of weird word game
>^ and trying to pretend the Standard means something else,
>^ but its meaing is quite clear.
>
>No, I am not playing a word game. I don't have a copy of any of the standards
>(I've never used them) so I am relying on the portions quoted in this thread.
>According to those quoted portions
>
>void main(void)
>{
> printf("Hello World!\n");
> /* return(0); implied */
>}
>
>is ANSI compliant code. If the standard specifically states elsewhere that, as
>you say, "void main(void); is illegal," then I am wrong. But according to
>what's been presented here I am correct.
>
>Frank
>
No expert, but I'm following this thread with a vague interest. A question
regarding GCC/EGCS (I have egcs-2.91.66) - if you build the above code with
"gcc -ansi wibble.c" (where wibble.c contains the code above).
egcs issues a warning, but otherwise the code builds and runs:
[158%][infinitum][src] >gcc --version
egcs-2.91.66
[159%][infinitum][src] >gcc -ansi wibble.c -o wibble
wibble.c: In function `main':
wibble.c:2: warning: return type of `main' is not `int'
[160%][infinitum][src] >./wibble
Hello World!
[161%][infinitum][src] >
Now - I would presume that gcc would have barfed if it was illegal behaviour,
not just warned. Is this classed as broken behaviour or not?
Curious,
Chris...
--
@}-,'-------------------------------------------------- Chris Johnson --'-{@
/ "(it is) crucial that we learn the difference / [EMAIL PROTECTED] \
/ between Sex and Gender. Therein lies the key / \
/ to our freedom" -- LB / www.nccnet.co.uk/~sixie \
------------------------------
From: [EMAIL PROTECTED] (Ulrich Weigand)
Subject: Re: ANSI C & void main()
Date: 13 May 2000 22:33:27 +0200
"Frank" <[EMAIL PROTECTED]> writes:
> "[... The main function] shall have a return type of type int...
>This addresses the type of the returned object, not how main() is defined.
> "...but otherwise its type is implementation-defined. [...]"
>Not it's addressing the type of main().
The type of a function is defined by specifying its return type and the
types of its arguments. The sentence I quoted gives the requirements
imposed by the standard on the type of the main function: its return
type must be int, the rest of the type (i.e. the argument types) is
implementation-defined.
--
Dr. Ulrich Weigand
[EMAIL PROTECTED]
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 13:47:38 -0700
Frank wrote:
> I meant that 'void main()' returns an integer according to the
> standard cited
> by Mark Graybill.
It doesn't. main returning void is illegal according to the Standard
that was cited.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Light ... more light!
\__/ (the last words of Goethe)
7 sisters productions / http://www.7sisters.com/
Web design for the future.
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 13:51:32 -0700
Frank wrote:
> No, I am not playing a word game. I don't have a copy of any of the
> standards
> (I've never used them) so I am relying on the portions quoted in this
> thread.
That's all you need to clearly see that main returning void is illegal.
> According to those quoted portions
>
> void main(void)
> {
> printf("Hello World!\n");
> /* return(0); implied */
> }
>
> is ANSI compliant code. If the standard specifically states elsewhere
> that, as
> you say, "void main(void); is illegal," then I am wrong. But according
> to
> what's been presented here I am correct.
No. You seem to be missing the key phrase, which was quoted in the
portions of the reference. "It [the main function] shall have a return
type of type int, but otherwise its type is implementation-defined."
That means that main must return int (_shall_ is a very strong word as
used in the Standard), but other than that implementations can support
their own list of arguments.
main _must_ return int. void main(void) is illegal. And all clearly
indicated by the quoted portions of the Standard posted here. That a
return 0 statement is implied if execution falls off the end of main is
true, but immaterial here, because in the code sample you're trying for,
main does not return int, and so therefore is already illegal. Besides,
your argument makes no sense; how can a return 0 be implied at the end
of a function which does not return int?
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Light ... more light!
\__/ (the last words of Goethe)
7 sisters productions / http://www.7sisters.com/
Web design for the future.
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: ANSI C & void main()
Date: Sat, 13 May 2000 13:52:35 -0700
Chris J/#6 wrote:
> Now - I would presume that gcc would have barfed if it was illegal
> behaviour,
> not just warned. Is this classed as broken behaviour or not?
Never turn to compilers to determine what's Standard conforming and
what's not.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Light ... more light!
\__/ (the last words of Goethe)
7 sisters productions / http://www.7sisters.com/
Web design for the future.
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************