Path: news.uiowa.edu!news.physics.uiowa.edu!math.ohio-state.edu!howland.reston.ans.net!nntp.crl.com!decwrl!tribune.usask.ca!rover.ucs.ualberta.ca!Myrias.AB.CA!eddore.myrias.com!eddore.myrias.com!not-for-mail From: gdr@eddore.myrias.com (Devin Reade) Newsgroups: comp.sys.apple2.programmer Subject: more Orca/C v2.0.3 bugs Date: 4 Feb 1996 20:05:10 -0700 Organization: Myrias Research Corporation Lines: 169 Message-ID: <4f3s56$3h5@eddore.myrias.com> NNTP-Posting-Host: eddore.myrias.com The following is the README from mail sent to Mike Westerfield and Soenke Behrens regarding bugs with Orca/C v2.0.3. Most of these only show up with questionable code. The bugs are, however, infractions of the ISO 9899-1990 standard. If you see [duplicate], that designates a previously reported bug. If you see [feature request], that designates something I have asked for, not a bug. Two descriptions refer to GNO; they are not reproducible under Orca/Shell and may not belong in a strictly Orca/C bug list. ===-------------------------------------------------- Deviations: ========== 1. Orca/C uses the (non-std) extended type for a lot of the functions. Text Editor: =========== 1. If the editor is used on files of more than one type (for example both C src and text files) concurrently, some filetypes get changed if the respective file is modified. The most common one seems to be text files getting changed to C source file types. This happens only under GNO/gsh, not ORCA/Shell. 2. [Feature request.] When opening files, it would be nice if the Open-Apple-down-arrow combination scrolled down the list a page rather than a file at a time. This would make it behave more like the usual desktop environment. 3. [Feature request.] The Orca text editor is a nice editor, but its biggest shortcoming when running under GNO is the lack of ability to suspend it. It would be nice if this capability were to be added. Preprocessor Bugs: ================= 1. The directive #define concat(a,b,c) a ## b ## c only concatenates the first two symbols, causing a parse error. [concat.c] [Duplicate] 2. This one is a Hiesenbug, and no code is included (contact Devin Reade if you need the source. You need to be able to compile under GNO to see this. You also need files and . When including a lot of header files, the Orca/C preprocessor forgets about some of its macros. I've been able to effectively have this code fragment: #ifdef Neg #error "it was already defined" #endif #ifndef Neg #define Neg (-113) #endif #ifndef Neg #error "this should not occur" #endif and have the compiler produce the second #error message but not the first. Compiler Bugs: ============= 1. "unsigned" is treated as "int", not "unsigned int". [cast.c] [Duplicate] 2. Equality/comparison operator conversion bug: unsigned char c1=255; signed char c2=-1; if ((unsigned char)c1 != (unsigned char) c2) { /* fail */ } Sections 6.3.9 and 6.2.1.5 are violated; c1 and c2 should be promoted to signed int. Because of the cast, their bit patterns should match and therefore compare equal. [cast.c] A similar case happens for comparison operators. [inequalops.c] 3. Declaration specifier limitation. According to section 6.5, we have: declaration-specifier: storage-class-specifier declaration-specifiers(opt) type-specifier declaration-specifiers(opt) type-qualifier declaration-specifiers(opt) This allows for declarations like: static char *one="one"; char static *two="two"; auto int three; int auto four; volatile s1 six; s1 auto seven; extern const volatile int eight; static const s1 nine; s1 volatile static ten; of which only some are permitted in Orca/C. [decl1.c] 4. Initialization error. The following declarations/initializations are valid (section 6.5.7). Orca/C flags the first as an error, and produces garbled strings at run-time for the remainder: [decl2.c, decl3.c] static char *s = &"thing"[1]; static char *a1 = "bletch"+1; static char *a2 = 1+"bletch"; A similar problem can be seen in file [sizeof.c]. 5. Modulo operator failure. Depending on the circumstances, doing a modulo (%) operation with a second number as the operand will either result in a nonsensical compile-time error ("illegal math operation in a constant expression") or a run-time error ("integer math error"). The standard says the behavior is implementation defined, but neither of the above fit that description. Further, the Orca/C manual states that the following relation holds regardless of the sign of the operands. "It jes' ain't so." [modulo.c] ((i/j)*j + i%j) == i 6. Faulty switch() statement. The int variable i does not get modified in the following statement. [stmttest.c] switch (2) { default: i = 20; } 7. Orca/C gets confused when compiling initializations of large structs. [test1.c]. Library Bugs: ============ 1. atof/strtod return value bugs. [max.c] char *real = " 1.2x",*p; atof(" 1.2") != 1.2 atof("-1.2") != -1.2 strtod(real,&p) != 1.2 strtod(" -1.2",NULL) != -1.2 2. printf %g precision bug. While the precision for %f and %e specifiers is taken to be the number of digits after the decimal, for the %g specifier it is supposed to be the number of _significant_ digits, in the usual scientific sense. Orca/C treats %g precision the same as it does for %f and %e. [printf.c] 3. Strtod() bug. If strtod is used on the following strings, it should set errno to ERANGE (it does) and return LONG_MIN and LONG_MAX, respectively (it doesn't). [string2.c] char *string1 ="-99999999999999999999999999999999999999999999999999999"; char *string2 ="999999999999999999999999999999999999999999999999999999";