[bug #9191] Compiler problem with #define's

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #9191] Compiler problem with #define's

Ondrej Lufinka

Update of bug #9191 (project lwip):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?9191>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #9191] Compiler problem with #define's

Ondrej Lufinka

Follow-up Comment #1, bug #9191 (project lwip):

The original (anonymous) poster should read the NC308 compiler manual.

In there it states that by default the compiler blatantly disobeys ANSI, and
if ANSI operation is required the compiler flag "-fETI" is required. Quoting
from the manual:

Function: Extends char type or signed char type data to int type data to
perform operation (extension as per ANSI rules).

Supplement: In ANSI standards, the char-type or singed char-type data is
always extended into the int type when evaluated. This extension is provided
to prevent a problem in char-type arithmetic operations, e.g., c1 = c2 * 2 /
c3; that the char type overflows in the middle of operation, and that the
result takes on an unexpected value.

And in the case of the original "GETSHORT()" macro, the operation "s = *cp++
<< 8" results in an explicit load of "s" with ZERO.

This is broken default compiler operation, but they do provide and document a
fix.

If anyone knows who "Anonymous" is, please forward this information back to
them.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?9191>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: [bug #9191] Compiler problem with #define's

snortreader
 
 

snortreader
2007-05-24

发件人: Tom Evans
发送时间: 2007-05-24 12:39:31
收件人: Tom Evans; [hidden email]
抄送:
主题: [lwip-devel] [bug #9191] Compiler problem with #define's
 
 
Follow-up Comment #1, bug #9191 (project lwip):
 
The original (anonymous) poster should read the NC308 compiler manual.
 
In there it states that by default the compiler blatantly disobeys ANSI, and
if ANSI operation is required the compiler flag "-fETI" is required. Quoting
from the manual:
 
Function: Extends char type or signed char type data to int type data to
perform operation (extension as per ANSI rules).
 
Supplement: In ANSI standards, the char-type or singed char-type data is
always extended into the int type when evaluated. This extension is provided
to prevent a problem in char-type arithmetic operations, e.g., c1 = c2 * 2 /
c3; that the char type overflows in the middle of operation, and that the
result takes on an unexpected value.
 
And in the case of the original "GETSHORT()" macro, the operation "s = *cp++
< < 8" results in an explicit load of "s" with ZERO.
 
This is broken default compiler operation, but they do provide and document a
fix.
 
If anyone knows who "Anonymous" is, please forward this information back to
them.
 
 
    _______________________________________________________
 
Reply to this item at:
 
 
_______________________________________________
  Message sent via/by Savannah
 
 
 
_______________________________________________
lwip-devel mailing list

_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel