patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9447, ping: guard ping_time with...

 
 

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

patch #9447: ping: guard ping_time with LWIP_DEBUG

Submitter:  Joel Cunningham <jcunningham>
Submitted:  Mon 28 Aug 2017 05:32:26 PM UTC
   
 
Category:  apps Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  jcunningham Open/Closed:  Closed
Planned Release:  None

Mon 28 Aug 2017 09:14:13 PM UTC, comment #4: 

I would be nice to have the module define (i.e. PING_DEBUG) control compiling out the LWIP_DEBUGF call, but I'm not sure how to do that.  A #define can't have further #if/#endif within it

Joel Cunningham <jcunningham>
Group Member
Mon 28 Aug 2017 07:32:03 PM UTC, comment #3: 

Right. I wonder if it's possible to improve those debugf defines depending more on the actual module's debug setting... I failed so far...

Simon Goldschmidt <goldsimon>
Group administrator
Mon 28 Aug 2017 06:59:08 PM UTC, comment #2: 


> but there's still the chance that debug is disabled via PING_DEBUG


I also tried using #if PING_DEBUG, but there an issue if LWIP_DEBUG is enabled, but not PING_DEBUG because ping_time is a parameter to LWIP_DEBUGF (regardless of whether PING_DEBUG is enabled or not)

I have submitted the patch in ddf21bd235531edb3e18aae84b803b9b239f995b for lwip-contrib

Joel Cunningham <jcunningham>
Group Member
Mon 28 Aug 2017 05:55:23 PM UTC, comment #1: 

Hmm, it makes thinigs a little better, but there's still the chance that debug is disabled via PING_DEBUG or even that LWIP_PLATFORM_DIAG isn't proberly defined.

But I guess your patch is the best portable solution without adding yet more defines.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 28 Aug 2017 05:32:26 PM UTC, original submission:  

Attached patch, commit message:


ping_time is only used in LWIP_DEBUGF statements.  When LWIP_DEBUG is
not defined (and by extension LWIP_DEBUGF is a no-op), this causes
compiler warning 550 with the ARMCC compiler:

 'ping_time was set but never used'


Just wanted to double check #ifdef LWIP_DEBUG is the correct guard for ping_time before submitting this change.  Reviews appreciated :)

Joel Cunningham <jcunningham>
Group Member

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by jcunningham (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-28 jcunningham StatusNone Done
        Open/ClosedOpen Closed
    2017-08-28 jcunningham Attached File- Added 0001-ping-guard-ping_time-with-LWIP_DEBUG.patch, #41689

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code