Changeset 163519a0 in rtems for testsuites/support


Ignore:
Timestamp:
Nov 19, 2014, 7:57:37 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
bc95f816
Parents:
a5201ea
git-author:
Joel Sherrill <joel.sherrill@…> (11/19/14 19:57:37)
git-committer:
Joel Sherrill <joel.sherrill@…> (11/20/14 18:57:33)
Message:

libtests/malloctest/init.c: Fix warning

posix_memalign() is prototyped to take a non-NULL parameter. But our
test is deliberately passing one in. With the -Wnon-null warning flag
enabled, we will always get warnings on this test unless we disable
that warning for this single test case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/support/include/tmacros.h

    ra5201ea r163519a0  
    1 /*  tmacros.h
     1/**
     2 * @file
    23 *
    3  *  This include file contains macros which are useful in the RTEMS
    4  *  test suites.
    5  *
    6  *  COPYRIGHT (c) 1989-2009.
     4 * This include file contains macros which are useful in the RTEMS
     5 * test suites.
     6 */
     7
     8/*
     9 *  COPYRIGHT (c) 1989-2014.
    710 *  On-Line Applications Research Corporation (OAR).
    811 *
     
    298301#define PRIxino_t "lx"
    299302
     303/**
     304 * This assists in clearly disabling warnings on GCC in certain very
     305 * specific cases.
     306 *
     307 * + -Wnon-null - If a method is declared as never having a NULL first
     308 *   parameter. We need to explicitly disable this compiler warning to make
     309 *   the code warning free.
     310 */
     311#ifdef __GNUC__
     312  #define COMPILER_DIAGNOSTIC_SETTINGS_PUSH _Pragma("GCC diagnostic push")
     313  #define COMPILER_DIAGNOSTIC_SETTINGS_POP _Pragma("GCC diagnostic pop")
     314  #define COMPILER_DIAGNOSTIC_SETTINGS_DISABLE_NONNULL \
     315    _Pragma("GCC diagnostic ignored \"-Wnonnull\"")
     316#else
     317  #define COMPILER_DIAGNOSTIC_SETTINGS_PUSH
     318  #define COMPILER_DIAGNOSTIC_SETTINGS_POP
     319  #define COMPILER_DIAGNOSTIC_SETTINGS_DISABLE_NONNULL
     320#endif
     321
    300322#ifdef __cplusplus
    301323}
Note: See TracChangeset for help on using the changeset viewer.