bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #43569] Fix for compile warnings with gcc 4.6.3


From: anonymous
Subject: [bug #43569] Fix for compile warnings with gcc 4.6.3
Date: Tue, 11 Nov 2014 14:36:00 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:33.0) Gecko/20100101 Firefox/33.0

Follow-up Comment #6, bug #43569 (project groff):

gcc(1) and clang(1) learned #pragma and i have found it valuable to exclude
normal users from useless messages by using them.
E.g. the following is from my MUA.

/* Suppress some technical warnings via #pragma's unless developing.
 * XXX Wild guesses: clang(1) 1.7 and (OpenBSD) gcc(1) 4.2.1 don't work */
#if !defined HAVE_DEBUG && !defined HAVE_DEVEL
# if PREREQ_CLANG(3, 4)
#  pragma clang diagnostic ignored "-Wunused-result"
#  pragma clang diagnostic ignored "-Wformat"
# elif PREREQ_GCC(4, 7)
#  pragma GCC diagnostic ignored "-Wunused-result"
#  pragma GCC diagnostic ignored "-Wformat"
# endif
#endif

the precondition of that is

#ifdef __clang__
# define CC_CLANG          1
# define PREREQ_CLANG(X,Y) 
   (__clang_major__ + 0 > (X) || 
    (__clang_major__ + 0 == (X) && __clang_minor__ + 0 >= (Y)))
# define __EXTEN           __extension__
#elif defined __GNUC__
# define CC_GCC            1
# define PREREQ_GCC(X,Y)   
   (__GNUC__ + 0 > (X) || (__GNUC__ + 0 == (X) && __GNUC_MINOR__ + 0 >= (Y)))
# define __EXTEN           __extension__
#endif

#ifndef CC_CLANG
# define CC_CLANG          0
# define PREREQ_CLANG(X,Y) 0
#endif
#ifndef CC_GCC
# define CC_GCC            0
# define PREREQ_GCC(X,Y)   0
#endif
#ifndef __EXTEN
# define __EXTEN
#endif

Something similar would surely make sense for groff.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43569>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]