osd@hou2d.UUCP (Orlando Sotomayor-Diaz) (07/03/85)
From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c> mod.std.c Digest Wed, 3 Jul 85 Volume 8 : Issue 4 Today's Topics: /* embedded in a comment the '\n' "character" UTC ---------------------------------------------------------------------- Date: Wed, 3 Jul 85 12:47:18 edt From: mark@cbosgd.ATT.UUCP (Mark Horton) Subject: /* embedded in a comment To: std-c@cbosgd.UUCP There are situations where you really want /* embedded in a comment. For example: #define DEBUG_MAIN 1 /* debugging prints in main program */ which can be portably turned off with /* #define DEBUG_MAIN 1 /* debugging prints in main program */ but this could generate a warning about an embedded /*. (Not all compilers support #if and #ifdef is a more widely used method, so changing 1 to 0 isn't really the answer.) Also consider where several possible values are kept around: /* #define MAX 512 /* for the PDP-11 */ #define MAX 1024 /* for the VAX */ /* #define MAX 4096 /* for the IBM 370 */ It's unreasonable to ifdef such things out. Thus, compilers that insist on printing warnings about embedded /* in comments will be a pain to use. This option should be switch selectable. Perhaps it would be less painful if it only checked comments that contain newlines. ------------------------------ Date: Wed, 3 Jul 85 12:47:18 edt From: mark@cbosgd.ATT.UUCP (Mark Horton) Subject: the '\n' "character" To: std-c@cbosgd.UUCP The \n "character" is somewhat more of a problem. The C language likes to pretend it's running on UNIX, and that this is handled by the operating system. However, there are a number of portability problems caused by this notion that bytes are bytes and that newlines will be intrepreted in the tty driver or terminal. The rest of the world (other operating systems and networks) use other conventions, such as length counts or CRLF terminated lines. Every C compiler for another operating system has had to implement a flag to fopen where the application programmer specifies whether the file is a text file or a binary file. For text files, \n gets turned into CRLF (or whatever the local convention is) and for binary files it gets left alone. The new OSI networking environment will require this sort of information at the presentation layer as well, even on UNIX. I don't have a wonderful solution to this, but a step in the right direction would be to standardize a flag to fopen which indicates that the file is (or is not, depending on the default) a text file. Otherwise, bytes should just be output bit for bit and their actions when printed should not be part of the standard. ------------------------------ Date: 3 Jul 85 01:29:37 CDT (Wed) From: ihnp4!utzoo!lsuc!msb Subject: UTC To: utzoo!ihnp4!hou2d!osd The correct abbreviation for Universal Coordinated Time is indeed UTC -- it's a French acronym. Mark Brader, know-it-all. ------------------------------ End of mod.std.c Digest - Wed, 3 Jul 85 16:03:34 EDT ****************************** USENET -> posting only through cbosgd!std-c. ARPA -> ... through cbosgd!std-c@BERKELEY.ARPA (NOT to INFO-C) In all cases, you may also reply to the author(s) above.