Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-3314

ASSERT_SRW_WAITBLOCK may evaluate to nothing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: ReactOS
      Platform: x86 Hardware

      Description

      target: lib/rtl/srw.c

      The patch below casts the ASSERT_SRW_WAITBLOCK macro to void, to prevent a no-effect expansion due to the strict handling of (variadic or not) macros in recent versions of GCC.
      Notice that build runs fine with -Wno-unused, but I think this goes against the purposes of -Werror in the build flags (and in fact, GCC 4.3+ break with this warning). This "problem" is nothing critical, but it will avoid future headhaches.

      Marcelo A. B. Slomp

      Index: lib/rtl/srw.c
      ===================================================================
      — lib/rtl/srw.c (revision 34937)
      +++ lib/rtl/srw.c (working copy)
      @@ -91,7 +91,8 @@
      /* This macro will cause the code to assert if compiled with a buggy
      version of GCC that doesn't align the wait blocks properly on the stack! */
      #define ASSERT_SRW_WAITBLOCK(ptr) \

      • ASSERT(((ULONG_PTR)ptr & ((1 << RTL_SRWLOCK_BITS) - 1)) == 0)
        + (_attribute_((unused))void) \
        + ASSERT(((ULONG_PTR)ptr & ((1 << RTL_SRWLOCK_BITS) - 1)) == 0)
        #else
        #define ASSERT_SRW_WAITBLOCK(ptr)
        #endif

        Attachments

        1. ex.h.diff
          0.6 kB
        2. srw.c.diff
          0.6 kB

          Issue Links

            Activity

              People

              • Assignee:
                Colin Finck Colin Finck
                Reporter:
                mslomp mslomp
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: