buglwIP - A Lightweight TCP/IP stack - Bugs: bug #23254, c library define are wrong

 
 

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

bug #23254: c library define are wrong

Submitted by:  Artem Migaev <klogg>
Submitted on:  Wed 14 May 2008 06:51:12 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Kieran Mansley <kieranm>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.3.0

Fri 30 May 2008 11:38:01 AM UTC, comment #1:

I've checked this in.

Resolving FIXED.

Thanks for the bug report.

Kieran Mansley <kieranm>
Project AdministratorIn charge of this item.
Wed 14 May 2008 06:51:12 PM UTC, original submission:

Under #if MEM_LIBC_MALLOC in mem.h we have following section:

#ifndef mem_free
#define mem_free(x) free(x)
#endif
#ifndef mem_malloc
#define mem_malloc(x) malloc(x)
#endif
#ifndef mem_calloc
#define mem_calloc(x, y) calloc(x, y)
#endif
#ifndef mem_realloc
#define mem_realloc(x, size) (x)
#endif

But this is completely wrong (especilly mem_realloc :), correct definition is:

#ifndef mem_free
#define mem_free free
#endif
#ifndef mem_malloc
#define mem_malloc malloc
#endif
#ifndef mem_calloc
#define mem_calloc calloc
#endif
#ifndef mem_realloc
#define mem_realloc realloc
#endif

In this case programmer can pass pointer to the macrodefined function, like we have in tcpip.c:

err_t
mem_free_callback(void *m)
{
return tcpip_callback_with_block(mem_free, m, 0);
}

Please, fix.

Thanks in advance, klogg

Artem Migaev <klogg>

 

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 kieranm (Posted a comment)
  • -unavailable- added by klogg (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
    Fri 30 May 2008 11:38:01 AM UTCkieranmStatusNone=>Fixed
      Assigned toNone=>kieranm
      Open/ClosedOpen=>Closed
      Planned Release=>1.3.1

    Back to the top


    Powered by Savane 3.1-cleanup1