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/


_______________________________________________
bug-groff mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-groff

Reply via email to