osd@hou2d.UUCP (Orlando Sotomayor-Diaz) (05/15/86)
From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c> mod.std.c Digest Thu, 15 May 86 Volume 16 : Issue 18 Today's Topics: MORE C standard differences Apr85-Feb86, part 8 of 9 ---------------------------------------------------------------------- Date: From: ihnp4!utzoo!lsuc!msb Subject: MORE C standard differences Apr85-Feb86, part 8 of 9 To: utzoo!ihnp4!hou2d!osd # D.12.2.1 The clock function * The clock function returns ... the processor time used {--> by the program} since the beginning of an implementation-defined era * {--> related only to the program invocation}. # D.12.2.2 The time function N--> The encoding of the value is unspecified. # D.12.2.2 The time function * The time function returns ... the current calendar time {since the beginning of an implementation-defined era -->}. # D.12.3.1 The asctime function The asctime function converts the broken-down time in the struc- * ture pointed to by timeptr into a {26-character -->} string in * the {following -->} form {. All the fields have constant width. -->} Sun Sep 16 01:03:52 1973\n\0 N--> using the equivalent of the following algorithm: N--> char *asctime(const struct tm *timeptr) N--> { N--> static const char wday_name[7][3] = { N--> "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" N--> }; N--> static const char mon_name[12][3] = { N--> "Jan", "Feb", "Mar", "Apr", "May", "Jun", N--> "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" N--> }; N--> static char result[26]; N--> (void) sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", N--> wday_name[timeptr->tm_wday], N--> mon_name[timeptr->tm_mon], N--> timeptr->tm_mday, timeptr->tm_hour, N--> timeptr->tm_min, timeptr->tm_sec, N--> 1900 + timeptr->tm_year); N--> return result; N--> } # C.12.3.2 The ctime function N--> It is equivalent to N--> asctime(localtime(timer)) N--> ... Forward references: the localtime function (#D.12.3.5). # {--> D.13 FUTURE DIRECTIONS} # {--> D.13.1 Character handling <ctype.h>} N--> Function names that begin with "is" and "to" and a lower-case N--> letter may be added to the declarations in the <ctype.h> header. # {--> D.13.2 Mathematics <math.h>} N--> The names of all existing functions declared in the <math.h> N--> header, suffixed with f or l, are reserved for corresponding N--> functions with float and long double arguments and return values, N--> respectively. # {--> D.13.3 Signal handling <signal.h>} N--> Macros that begin with SIG and an upper-case letter may be added N--> to the definitions in the <signal.h> header. # {--> D.13.4 Input/output <stdio.h>} N--> The use of leading 0 in fprintf format to request padding with N--> leading zeros is deprecated. Use the "precision" specifier in- N--> stead. N--> Lower-case letters may be added to the conversion specifiers in N--> fprintf and fscanf. Other characters may be used in extensions. # {--> D.13.5 String handling <string.h> N--> Function names that begin with "str" and "mem" and a lower-case N--> letter may be added to the declarations in the <string.h> header. # E. APPENDICES Remark: Since the appendices are not part of the Standard, I have included only certain ones here. The ones I included were the new section #E.2 Sequence Points, section #{E.3 --> E.5} Common Warnings, and section #{E.5 --> E.6} Portability Issues. # {--> E.2 SEQUENCE POINTS} N--> The following are the sequence points described in #B.1.2.3. N--> * The call to a function, after the arguments have been evaluated N--> (#C.3.2.2). N--> * The logical AND operator && (#C.3.2.13). N--> * The logical OR operator || (#C.3.2.14). N--> * The conditional operator ? (#C.3.2.15). N--> * The comma operator , (#C.3.2.17). N--> * Completion of the evaluation of a full expression: an initial- N--> izer of an object that has automatic storage duration (#C.5.6); N--> the expression in an expression statement (#C.6.3); the con- N--> trolling expression of a selection statement (if or switch) N--> (#C.6.4); the controlling expression of an iteration statement N--> (while, do, or for) (#C.6.5). # {E.3 --> E.5} COMMON WARNINGS * An implicit narrowing conversion is encountered, such as the * assignment of a long int or a double to an int {-->, or a pointer to void to a pointer to any type of object other than char (#C.2)}. ... <--O * A declaration with no effect is encountered (#C.5). N--> * An object is defined but not used (#C.5). # {E.5.1 --> E.6.1} Unspecified behavior N--> * The behavior if a printable character is written when the ac- N--> tive position is at the final position of a line (#B.2.2). N--> * The behavior if a backspace character is written when the ac- N--> tive position is at the initial position of a line (#B.2.2). N--> * The behavior if a horizontal tab character is written when the N--> active position is at or past the last defined horizontal tabu- N--> lation position (#B.2.2). N--> * The behavior if a vertical tab character is written when the N--> active position is at or past the last defined vectical tabula- N--> tion position (#B.2.2). # {E.5.1 --> E.6.1} Unspecified behavior N--> * The order in an array sorted by the qsort function of two N--> members that compare as equal (#D.10.5.2). # {E.5.1 --> E.6.1} Unspecified behavior N--> * The encoding of the calendar time returned by the time function N--> (#D.12.2.2). ------------------------------ End of mod.std.c Digest - Thu, 15 May 86 13:32:29 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.