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

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Mon 18 Jan 2010 07:40:26 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Compiler WarningStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 26 Jan 2010 04:11:18 PM UTCgoldsimonStatusIn Progress=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Mon 25 Jan 2010 08:18:34 AM UTCgoldsimonStatusNeed Info=>In Progress

    Back to the top


    Powered by Savane 3.1-cleanup1