more questions...

Joseph S. D. Yao jsdy at hadron.UUCP
Sat Feb 1 02:58:42 AEST 1986


In article <181 at rexago1.UUCP> rich at rexago1.UUCP (K. Richard Magill) writes:
>What's an error 0?  What causes it?

Typically, a call to perror() after an error that did not set 'errno',
such as a non-function-call error return.  Program bug.

>Where does the message "not a tty." come from & why?

Again, from perror(): this time, the last thing to set 'errno' was a
system call that expected to see a character-oriented or perhaps even
login-tty-type device but did not.  Example: ioctl() on the block disk
device.

>Where does a signal 0 come from? why?

Give an example.  I don't remember seeing one.

>What's wrong with this fragment that I always get an enumeration type clash
>warning about?  Isn't an enum an integral type?
>	enum { ... } x;
>	switch (x) {
>	...
>This is mostly from a 3b2/300 running Sv.2.2.

An enum is not really an integral type, although there are several
disagreements as to what it really is.  I.e., there are even compilers
that allow ordering in enums: you can compare them with '<' etc.
The best ("most portable") assumption to make is that enums are
"discrete" types, and comparison for equality and assignment are the
operations best done on them.  (Although I would ha' thought that
that implies that a switch() would work.  Are you sure that everything
else -- x and all the constants' names -- are legal where they are?)

s5r1v1:  "Enumerations are unique types with named constants.  However,
the current language treats enumeration variables and constants as
being of \fBint\fP type."  No guarantees it would stay that way.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list