rich@rexago1.UUCP (K. Richard Magill) (01/29/86)
While I'm at it... What's an error 0? What causes it? Where does the message "not a tty." come from & why? Where does a signal 0 come from? why? 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. K. Richard Magill "I have a yen for some Japanese food", he said occidentally.
jsdy@hadron.UUCP (Joseph S. D. Yao) (01/31/86)
In article <181@rexago1.UUCP> rich@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@seismo.{CSS.GOV,ARPA,UUCP}