home *** CD-ROM | disk | FTP | other *** search
- *****
-
- The following bugs were listed by Gene Alm on 14 June 1987.
- As of this writing, they have NOT been reported to Frank
- Borland by the reporter. They will be reported within a day
- or two.
-
- ***
-
- Error Class: Error in math.h
-
- In the header file math.h, you will find:
-
- #define M_PI 3.14159265358979224
-
- This should read:
-
- #define M_PI 3.14159265358979324
-
- Reference: Don Knuth, Seminumerical Algorithms
-
- Comments: I have not checked any other values. Are
- there any other dumb errors in these
- constants???
-
- Disposition: Unreported
-
- ***
-
- Error Class: Documentation error
-
- On page 144 of the Users Guide, there is an error in
- the syntax shown for enumerated variables. It reads:
-
- enum days = { Sun, Mon, Tues, Wed,
- Thurs, Fri, Sat };
-
- It should read:
-
- enum days { Sun, Mon, Tues, Wed,
- Thurs, Fri, Sat };
-
- Reference: Lattice C Compiler Version 3.00 Technical
- Bulletin
-
- Comments: The enum data type is quite a bit more flexible
- than implied in the illustration given. Consult
- a good reference.
-
- Disposition: Unreported
-
- ***
-
- Error Class: Documentation error
-
- On page 297 of the Reference Guide, it states that the
- -nxxx environment option sends the .OBJ and .ASM files
- to the directory or path given in xxx.
-
- It ALSO sends load modules (.EXE) files to this path.
-
- Reference: Try it and see!
-
- Comments: I like to send temporary files (I usually
- consider .OBJ files as temporaries) to a ramdisk
- for speed but like to keep load modules on the
- current drive (hard disk). The command line
- options by themselves don't seem to support
- sending .OBJ and .EXE files to different drives
- (paths).
-
- Disposition: Unreported
-
- ***
-
- Error Class: Documentation error
-
- On page 18 of the Reference Guide, the usage for _fmode
- is shown as:
-
- extern int _fmode;
-
- If you look in the fcntl.h header file, you will discover
- that the declaration is:
-
- extern unsigned _Cdecl _fmode;
-
- This confusion between an integer and an unsigned may
- manifest itself in a warning message during compilation.
-
- Reference: See for yourself!
-
- Comments: This is a common nuisance for a new product.
- The documentation doesn't agree with the facts.
- So assume the facts are correct. Go with the
- declaration as shown in the header file since
- it is PROBABLY more current than the manual.
-
- Disposition: Unreported
-
- ***
-
- Error class: Compiler error
-
- If the following code is compiled, the compiler will return
- a message that "code in line 9 has no effect." Well
- that is not true since if you execute the program the results
- that are listed via the two printf statements are different.
- The code does indeed have an effect. Fortunately the compiler
- ignores its own warning and generates the correct code for a
- statement that it says is redundant. The statement is
- syntactically correct. The leading asterisk indicates a
- dereferencing that is not used and this appears to be the
- problem that the compiler recoginzes. Removing this asterisk
- causes the message to disappear. But in C, I am allowed to
- do what I want to do even if it makes no sense! The compiler
- should issue a redundant operator message, not a redundant
- code message!
-
- static int a[] = {0, 1, 2, 3, 4};
- static int *p[] = {a, a+1, a+2, a+3, a+4};
- static int **pp;
-
- void main () {
-
- pp = p;
- printf ("\n%10d%10d%10d", pp-p, *pp-a, **pp);
- *++*pp;
- printf ("\n%10d%10d%10d", pp-p, *pp-a, **pp);
- }
-
- Reference: Kernighan and Ritchie
-
- Comments: When receiving a message such as "code is
- bad", just how much of it is bad? If the compiler
- recognizes redundant operators or statements,
- it might well inform the programmer of the "find".
- Other compilers don't inform the user that a
- redundant construct has been used. I am delighted
- that this environment tells me about it. More
- often than not, such a message will indicate that
- there is a problem. But don't simply say that code
- is bad.
-
- Disposition: Unreported
-
- ***
-
- Documentation error
-
- On page 78 of the Reference Guide, the usage for
- farcoreleft is given as:
-
- long farcoreleft (void);
-
- In the alloc.h header file, the prototype is shown as:
-
- unsigned long _Cdecl farcoreleft(void);
-
- Reference: See for yourself
-
- Comments: Once again, if the documentation differs from
- the information given in a header file, assume
- that the header file contains the latest, and
- therefore the most correct information.
-
- Disposition: Unreported
-
- ***
-
- Error class: Compiler error
-
- When the following program is executed, you will get
- two different results. Casting values in the expression
- for xr0 does not alter the situation.
-
- #define MAX_POINTS 16
-
- main () {
-
- int points, index;
- double xr0, xr1;
-
- points = MAX_POINTS;
- for (index = 0; index < points; index++) {
- xr0 = 512.0 / MAX_POINTS * index;
- xr1 = 512 / MAX_POINTS * index;
- printf ("\n%20.6lf%20.6lf", xr0, xr1);
- }
- }
-
- Reference: Kernighan and Ritchie
-
- Comments: If the order of the terms in xr0 is changed
- (xr0 = 512.0 * index / MAX_POINTS), the results
- will change. Since the order of the terms should
- make no difference, this is a serious bug. Other
- compilers handle the above code with no problem.
- It appears as though the compiler doesn't like
- the appearance of two constants together. If
- you suspect this problem, interchange the order
- of the terms.
-
- Disposition: Unreported
-
- ***
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-