buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28659, Missing casts: compile error when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28659: Missing casts: compile error when using C++ OS headers

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Mon 18 Jan 2010 07:40:26 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Compiler Warning Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Tue 26 Jan 2010 04:11:18 PM UTC, comment #5: 

OK, I got it, thanks for the input. I should have found that, too, but somehow my lwipopts.h had that code disabled.

Simon Goldschmidt <goldsimon>
Group administrator
Tue 26 Jan 2010 03:22:15 PM UTC, comment #4: 

ppp.c <line 767>
pb = pbuf_alloc(PBUF_LINK, PPPOE_HDRLEN + sizeof(protocol), PBUF_RAM);

macro PPPOE_HDRLEN defined in ppp_oe.h <line 158>

#define PPPOE_HDRLEN (sizeof(struct eth_hdr) + PPPOE_HEADERLEN)




hanhui <hanhui03>
Tue 26 Jan 2010 01:50:11 PM UTC, comment #3: 

... that leads us to 2 questions:
1) what does that have to do with missing casts and
2) which file are you talking about? The ppp.c file that I checked out does not use struct eth_hdr!

Simon Goldschmidt <goldsimon>
Group administrator
Tue 26 Jan 2010 01:18:55 PM UTC, comment #2: 

ppp.c not include file: netif/etharp.h.

so the definition of "struct eth_hdr" is not declared!


hanhui <hanhui03>
Mon 25 Jan 2010 08:18:34 AM UTC, comment #1: 

Adding them as noone objects...

Simon Goldschmidt <goldsimon>
Group administrator
Mon 18 Jan 2010 07:40:26 AM UTC, original submission:  

I'm currently at a project where we use C++ OS headers (for the sys_arch.h defines). Since these defines are replaced by actual C++ code (e.g. SYS_ARCH_PROTECT is replaced by OS::Protect()), I need to compile the C files as C++-code.

There are many warnings I can turn off, but at least under MS-VS, missing casts (e.g. from void* to struct eth_hdr*) are an error (not a warning), which can't be turned off.

I know that the casts are not required in C (but still allowed), but there's no way to compile the code using my OS'es defines like it is now: I'd have to switch to using (slow) functions instead of defines.

So the question is: Does anyone have anything against me adding these casts?

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hanhui03 (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-01-26 goldsimon StatusIn Progress Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2010-01-25 goldsimon StatusNeed Info In Progress

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code