Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] master 0d2dd00: Fix -Wabsolute-value in
From: "Maynard, Chris" <[email protected]>
Date: Sat, 15 Mar 2014 10:32:21 -0400
I don't think this is the correct fix.  The intent was to get the absolute value of the *difference* between 2 values, which could be negative, hence "abs(a - b)".

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Wireshark code review
Sent: Saturday, March 15, 2014 7:38 AM
To: [email protected]
Subject: [Wireshark-commits] master 0d2dd00: Fix -Wabsolute-value in ICMP dissector (found by Clang 3.5)

URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=0d2dd005647d173959fdd1794ff04840eb5e8cd4
Submitter: Anders Broman ([email protected])
Changed: branch: master
Repository: wireshark

Commits:

0d2dd00 by Alexis La Goutte ([email protected]):

    Fix -Wabsolute-value in ICMP dissector (found by Clang 3.5)
    
    packet-icmp.c:1245:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1245:7: note: remove the call to 'abs' since unsigned values cannot be negative
    packet-icmp.c:1245:30: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1245:30: note: remove the call to 'abs' since unsigned values cannot be negative
    packet-icmp.c:1254:6: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1254:6: note: remove the call to 'abs' since unsigned values cannot be negative
    packet-icmp.c:1254:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1254:29: note: remove the call to 'abs' since unsigned values cannot be negative
    packet-icmp.c:1623:7: error: taking the absolute value of unsigned type 'guint32' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1623:7: note: remove the call to 'abs' since unsigned values cannot be negative
    packet-icmp.c:1629:7: error: taking the absolute value of unsigned type 'guint32' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value]
    packet-icmp.c:1629:7: note: remove the call to 'abs' since unsigned values cannot be negative
    
    Change-Id: I6b344d01b8239fb93aedf95d954ef1243ba45a6b
    Reviewed-on: https://code.wireshark.org/review/673
    Reviewed-by: Anders Broman <[email protected]>
    

Actions performed:

    from  3094062   Use constants instead of vwr->STATS_LEN in some cases.
    adds  0d2dd00   Fix -Wabsolute-value in ICMP dissector (found by Clang 3.5)


Summary of changes:
 epan/dissectors/packet-icmp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-) ___________________________________________________________________________
Sent via:    Wireshark-commits mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-commits
Unsubscribe: https://wireshark.org/mailman/options/wireshark-commits
             mailto:[email protected]?subject=unsubscribe
CONFIDENTIALITY NOTICE: The information contained in this email message is intended only for use of the intended recipient. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately delete it from your system and notify the sender by replying to this email.  Thank you.