lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: [lwip-users] ioctl() plus compiler warnings/errors


From: leon . woestenberg
Subject: Re: AW: [lwip-users] ioctl() plus compiler warnings/errors
Date: Tue, 18 Feb 2003 13:40:29 +0100

Hello Florian,

> They are, but that doesn't help in this case. It's probably a compiler
> error, not to cut the constant to the correct length of the variable if
> possible.

> #define TF_FOO 0x2U
> char c;

> This works:
> c = TF_FOO;

> This doesn't:
> c = ~TF_FOO
>
But what if you define 'c' as being a 'unsigned char'? If you are using it
as a set of flags, this should really work.

Leon.



|---------+------------------------------------------------------>
|         |           "Zschocke, Florian" <address@hidden>  |
|         |           Sent by:                                   |
|         |           lwip-users-bounces+leon.woestenberg=axon.tv|
|         |           @nongnu.org                                |
|         |                                                      |
|         |                                                      |
|         |           17-02-2003 16:47                           |
|         |           Please respond to Mailing list for lwIP    |
|         |           users                                      |
|         |                                                      |
|---------+------------------------------------------------------>
  
>----------------------------------------------------------------------------------------------|
  |                                                                             
                 |
  |       To:       'Mailing list for lwIP users' <address@hidden>              
          |
  |       cc:                                                                   
                 |
  |       Subject:  AW: [lwip-users] ioctl() plus compiler warnings/errors      
                 |
  
>----------------------------------------------------------------------------------------------|




address@hidden wrote on Montag, 17. Februar 2003 16:36:

> Hello,
>
> I think the preferable method is to define the constants with a
> U suffix (unsigned).

They are, but that doesn't help in this case. It's probably a compiler
error, not to cut the constant to the correct length of the variable if
possible.

#define TF_FOO 0x2U
char c;

This works:
c = TF_FOO;

This doesn't:
c = ~TF_FOO

This does:

c = (char)~TF_FOO

Florian.


_______________________________________________
lwip-users mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/lwip-users








reply via email to

[Prev in Thread] Current Thread [Next in Thread]