PATCH to toplev.c: Guard use of "extern inline"

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Jan 29 16:25:00 GMT 2006


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

| + /* When compiling with a recent enough GCC, we use the GNU C "extern inline"
| +    for floor_log2 and exact_log2; see toplev.h.  That construct, however,
| +    conflicts with the ISO C++ One Definition Rule.   */
| + 
| + #if !defined (__cplusplus)

but then the test does not reflect the comment.  My thinko.  
We must define those functions, except when we use a recent enough GNU
C++ compiler.
Fixed thusly.

-- Gaby
2006-01-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
 	* toplev.c: Fix thinko.
 
*** toplev.c	(revision 110375)
--- toplev.c	(local)
*************** read_integral_parameter (const char *p, 
*** 520,526 ****
     for floor_log2 and exact_log2; see toplev.h.  That construct, however,
     conflicts with the ISO C++ One Definition Rule.   */
  
! #if !defined (__cplusplus)
  
  /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
     If X is 0, return -1.  */
--- 520,526 ----
     for floor_log2 and exact_log2; see toplev.h.  That construct, however,
     conflicts with the ISO C++ One Definition Rule.   */
  
! #if GCC_VERSION < 3004 || !defined (__cplusplus)
  
  /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
     If X is 0, return -1.  */
*************** exact_log2 (unsigned HOST_WIDE_INT x)
*** 572,578 ****
  #endif
  }
  
! #endif /* !defined (__cplusplus)  */
  
  /* Handler for fatal signals, such as SIGSEGV.  These are transformed
     into ICE messages, which is much more user friendly.  In case the
--- 572,578 ----
  #endif
  }
  
! #endif /*  GCC_VERSION < 3004 || !defined (__cplusplus)  */
  
  /* Handler for fatal signals, such as SIGSEGV.  These are transformed
     into ICE messages, which is much more user friendly.  In case the



More information about the Gcc-patches mailing list