Project

General

Profile

Actions

Bug #2169

closed

arpa/nameser_compat.h: wrong macros

Added by Igor Pashev over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Start date:
2012-02-23
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

arpa/nameser_compat.h has macros to test endianless but it work incorretcly at least with GCC 4.7 :-)
Parentheses are needed.

# diff -dub nameser_compat.h nameser_compat.h.new
--- nameser_compat.h    2012-02-23 19:20:34.000000000 +0400
+++ nameser_compat.h.new    2012-02-23 19:22:06.000000000 +0400
@@ -110,15 +110,15 @@
 #endif /* BYTE_ORDER */

 #if !defined(BYTE_ORDER) || \
-    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
-    BYTE_ORDER != PDP_ENDIAN)
+    ((BYTE_ORDER != BIG_ENDIAN) && (BYTE_ORDER != LITTLE_ENDIAN) && \
+    (BYTE_ORDER != PDP_ENDIAN))
     /*
      * you must determine what the correct bit order is for
      * your compiler - the next line is an intentional error
      * which will force your compiles to bomb until you fix
      * the above macros.
      */
-    error "Undefined or invalid BYTE_ORDER";
+#    error "Undefined or invalid BYTE_ORDER";
 #endif

 /*


Files

nameser_compat.h.patch (704 Bytes) nameser_compat.h.patch patch Igor Pashev, 2012-02-23 03:29 PM
Actions #1

Updated by Igor Pashev over 9 years ago

In any way #1777 is prefered.

Actions #2

Updated by Electric Monk over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 5566946ddee5d74cd7ce592465b954f7d90f62f7

commit  5566946ddee5d74cd7ce592465b954f7d90f62f7
Author: Igor Pashev <pashev.igor@gmail.com>
Date:   2016-03-10T20:02:56.000Z

    2169 arpa/nameser_compat.h: wrong macros
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Lauri Tirkkonen <lotheac@iki.fi>
    Approved by: Garrett D'Amore <garrett@damore.org>

Actions

Also available in: Atom PDF