]> granicus.if.org Git - gc/commitdiff
Adjust #error messages format
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Nov 2018 18:25:29 +0000 (21:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 26 Nov 2018 06:26:14 +0000 (09:26 +0300)
(code refactoring)

Remove double quotes, "-->" prefix and the trailing dot from the error
messages.

* include/private/gcconfig.h [hp9000s300 && !CPPCHECK]: Adjust #error
message format.
* include/private/gcconfig.h [ibm032 && !CPPCHECK]: Likewise.
* include/private/gcconfig.h [!mach_type_known && !CPPCHECK]: Likewise.
* include/private/gcconfig.h [HEXAGON && (!__GLIBC__ || __GLIBC__ < 2
|| !__ELF__ && !CPPCHECK || !LINUX)]: Likewise.
* include/private/gcconfig.h [!ALIGNMENT && !CPPCHECK]: Likewise.
* include/private/gcconfig.h [!STACKBOTTOM && (ECOS || NOSYS)
&& !CPPCHECK]: Likewise.
* include/private/gcconfig.h [!CPPCHECK && (GC_IRIX_THREADS
|| GC_LINUX_THREADS || GC_NETBSD_THREADS || GC_FREEBSD_THREADS
|| GC_SOLARIS_THREADS || GC_HPUX_THREADS || GC_AIX_THREADS
|| GC_WIN32_THREADS || GC_WIN32_PTHREADS)]: Likewise.
* include/private/gcconfig.h [PARALLEL_MARK && !THREADS && !CPPCHECK]:
Likewise.
* include/private/gcconfig.h [!CPPCHECK && (MARK_BIT_PER_GRANULE
&& MARK_BIT_PER_OBJ || STACK_GROWS_UP && STACK_GROWS_DOWN
|| !STACK_GROWS_UP && !STACK_GROWS_DOWN || REDIRECT_MALLOC && THREADS
&& !LINUX && !REDIRECT_MALLOC_IN_HEADER)]: Likewise.
* os_dep.c [(MMAP_SUPPORTED || ADD_HEAP_GUARD_PAGES) && USE_MUNMAP
&& !USE_MMAP && !CPPCHECK]: Likewise.
* win32_threads.c [!I386 && !X86_64 && !ARM32 && !AARCH64 && !SHx
!MIPS && !PPC && !ALPHA && !CPPCHECK] (GC_push_stack_for): Likewise.

include/private/gcconfig.h
os_dep.c
win32_threads.c

index fae6379c32ede1c4e515d693ab1c0eebb5310cdf..d1ad8160e6eeccedc6f218c8b0a8e9b933620134 100644 (file)
@@ -171,7 +171,7 @@ EXTERN_C_BEGIN
 #    error SUNOS4 no longer supported
 # endif
 # if defined(hp9000s300) && !defined(CPPCHECK)
-#    error M68K based HP machines no longer supported.
+#    error M68K based HP machines no longer supported
 # endif
 # if defined(OPENBSD) && defined(m68k)
 #    define M68K
@@ -276,7 +276,7 @@ EXTERN_C_BEGIN
 #    define mach_type_known
 # endif
 # if defined(ibm032) && !defined(CPPCHECK)
-#   error IBM PC/RT no longer supported.
+#   error IBM PC/RT no longer supported
 # endif
 # if (defined(sun) || defined(__sun)) && (defined(sparc) || defined(__sparc))
             /* Test for SunOS 5.x */
@@ -695,7 +695,7 @@ EXTERN_C_BEGIN
 /* SYSV on an M68K actually means A/UX.                                 */
 /* The distinction in these cases is usually the stack starting address */
 # if !defined(mach_type_known) && !defined(CPPCHECK)
-#   error "The collector has not been ported to this machine/OS combination."
+#   error The collector has not been ported to this machine/OS combination
 # endif
                     /* Mapping is: M68K       ==> Motorola 680X0        */
                     /*             (NEXT, and SYSV (A/UX),              */
@@ -2808,15 +2808,15 @@ EXTERN_C_BEGIN
 #           if defined(__GLIBC__) && __GLIBC__ >= 2
 #               define SEARCH_FOR_DATA_START
 #           else
-#               error --> unknown Hexagon libc configuration
+#               error Unknown Hexagon libc configuration
 #           endif
             extern int _end[];
 #           define DATAEND ((ptr_t)(_end))
 #       elif !defined(CPPCHECK)
-#           error --> bad Hexagon Linux configuration
+#           error Bad Hexagon Linux configuration
 #       endif
 #   else
-#       error --> unknown Hexagon OS configuration
+#       error Unknown Hexagon OS configuration
 #   endif
 # endif
 
@@ -3037,11 +3037,11 @@ EXTERN_C_BEGIN
 # undef CPP_WORDSZ
 # define CPP_WORDSZ (__SIZEOF_POINTER__ * 8)
 #elif CPP_WORDSZ != 32 && CPP_WORDSZ != 64
-# error Bad word size
+#   error Bad word size
 #endif
 
 #if !defined(ALIGNMENT) && !defined(CPPCHECK)
-# error --> undefined ALIGNMENT
+# error Undefined ALIGNMENT
 #endif
 
 #ifdef PCR
@@ -3056,7 +3056,7 @@ EXTERN_C_BEGIN
 
 #if !defined(STACKBOTTOM) && (defined(ECOS) || defined(NOSYS)) \
     && !defined(CPPCHECK)
-# error --> undefined STACKBOTTOM
+# error Undefined STACKBOTTOM
 #endif
 
 #ifdef IGNORE_DYNAMIC_LOADING
@@ -3228,33 +3228,33 @@ EXTERN_C_BEGIN
 #endif
 
 #if !defined(CPPCHECK)
-#if defined(GC_IRIX_THREADS) && !defined(IRIX5)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_LINUX_THREADS) && !defined(LINUX) && !defined(NACL)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_NETBSD_THREADS) && !defined(NETBSD)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_FREEBSD_THREADS) && !defined(FREEBSD)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_SOLARIS_THREADS) && !defined(SOLARIS)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_HPUX_THREADS) && !defined(HPUX)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_AIX_THREADS) && !defined(_AIX)
-# error --> inconsistent configuration
-#endif
-#if defined(GC_WIN32_THREADS) && !defined(CYGWIN32) && !defined(MSWIN32) \
-    && !defined(MSWINCE) && !defined(MSWIN_XBOX1)
-# error --> inconsistent configuration
-#endif
+# if defined(GC_IRIX_THREADS) && !defined(IRIX5)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_LINUX_THREADS) && !defined(LINUX) && !defined(NACL)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_NETBSD_THREADS) && !defined(NETBSD)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_FREEBSD_THREADS) && !defined(FREEBSD)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_SOLARIS_THREADS) && !defined(SOLARIS)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_HPUX_THREADS) && !defined(HPUX)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_AIX_THREADS) && !defined(_AIX)
+#   error Inconsistent configuration
+# endif
+# if defined(GC_WIN32_THREADS) && !defined(CYGWIN32) && !defined(MSWIN32) \
+     && !defined(MSWINCE) && !defined(MSWIN_XBOX1)
+#   error Inconsistent configuration
+# endif
 # if defined(GC_WIN32_PTHREADS) && defined(CYGWIN32)
-#   error --> inconsistent configuration
+#   error Inconsistent configuration
 # endif
 #endif /* !CPPCHECK */
 
@@ -3266,7 +3266,7 @@ EXTERN_C_BEGIN
 #endif
 
 #if defined(PARALLEL_MARK) && !defined(THREADS) && !defined(CPPCHECK)
-# error "invalid config - PARALLEL_MARK requires GC_THREADS"
+# error Invalid config: PARALLEL_MARK requires GC_THREADS
 #endif
 
 #if (((defined(MSWIN32) || defined(MSWINCE)) && !defined(__GNUC__)) \
@@ -3503,21 +3503,19 @@ EXTERN_C_BEGIN
 
 /* Some static sanity tests.    */
 #if !defined(CPPCHECK)
-#if defined(MARK_BIT_PER_GRANULE) && defined(MARK_BIT_PER_OBJ)
-# error Define only one of MARK_BIT_PER_GRANULE and MARK_BIT_PER_OBJ.
-#endif
-
-#if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
-# error "Only one of STACK_GROWS_UP and STACK_GROWS_DOWN should be defd."
-#endif
-#if !defined(STACK_GROWS_UP) && !defined(STACK_GROWS_DOWN)
-# error "One of STACK_GROWS_UP and STACK_GROWS_DOWN should be defd."
-#endif
-
-#if defined(REDIRECT_MALLOC) && defined(THREADS) && !defined(LINUX) \
+# if defined(MARK_BIT_PER_GRANULE) && defined(MARK_BIT_PER_OBJ)
+#   error Define only one of MARK_BIT_PER_GRANULE and MARK_BIT_PER_OBJ
+# endif
+# if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
+#   error Only one of STACK_GROWS_UP and STACK_GROWS_DOWN should be defined
+# endif
+# if !defined(STACK_GROWS_UP) && !defined(STACK_GROWS_DOWN)
+#   error One of STACK_GROWS_UP and STACK_GROWS_DOWN should be defined
+# endif
+# if defined(REDIRECT_MALLOC) && defined(THREADS) && !defined(LINUX) \
      && !defined(REDIRECT_MALLOC_IN_HEADER)
-# error "REDIRECT_MALLOC with THREADS works at most on Linux."
-#endif
+#   error REDIRECT_MALLOC with THREADS works at most on Linux
+# endif
 #endif /* !CPPCHECK */
 
 #ifdef GC_PRIVATE_H
index c3e3fbf3fc2b729d8e33e62fb08e66dfc0824a32..45abd33f590e6dc692328964281f0be2b7be702a 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -71,7 +71,7 @@
 
 #if defined(MMAP_SUPPORTED) || defined(ADD_HEAP_GUARD_PAGES)
 # if defined(USE_MUNMAP) && !defined(USE_MMAP) && !defined(CPPCHECK)
-#   error "invalid config - USE_MUNMAP requires USE_MMAP"
+#   error Invalid config: USE_MUNMAP requires USE_MMAP
 # endif
 # include <sys/types.h>
 # include <sys/mman.h>
index d99f4d3648bf26f2914c428bc346cbea8d1cac91..75a909174de8d0d3d3a740cfb7f1cb0f480715b9 100644 (file)
@@ -1449,7 +1449,7 @@ STATIC word GC_push_stack_for(GC_thread thread, DWORD me)
       PUSH4(IntT10,IntT11,IntT12,IntAt);
       sp = (ptr_t)context.IntSp;
 #   elif !defined(CPPCHECK)
-#     error "architecture is not supported"
+#     error Architecture is not supported
 #   endif
   } /* ! current thread */