home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2813 < prev    next >
Encoding:
Text File  |  1992-11-21  |  6.9 KB  |  271 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!cus.cam.ac.uk!pc123
  3. From: pc123@cus.cam.ac.uk (Pete Chown)
  4. Subject: Problem with GCC 2.3.1
  5. Message-ID: <PC123.92Nov21150904@bootes.cus.cam.ac.uk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: U of Cambridge, England
  8. Distribution: gnu
  9. Date: Sat, 21 Nov 1992 15:09:08 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 258
  12.  
  13. I wrote the following into a file called foo.c:
  14.  
  15. extern "C" {
  16.   #include </usr/lib/gnu/gcc/g++-include/stdio.h>
  17. }
  18.  
  19. and then I compiled it:
  20.  
  21. cl: ~/project/compile (1) $ g++ foo.c
  22. pid 9415 (cpp) was killed on an unaligned access, at pc 0x405d1c 
  23. /usr/bin/gcc: Internal compiler error: program cpp got fatal signal 10
  24.  
  25. The header file included above looks like this:
  26.  
  27. // This may look like C code, but it is really -*- C++ -*-
  28. /* 
  29. Copyright (C) 1988 Free Software Foundation
  30.     written by Doug Lea (dl@rocky.oswego.edu)
  31.  
  32. This file is part of the GNU C++ Library.  This library is free
  33. software; you can redistribute it and/or modify it under the terms of
  34. the GNU Library General Public License as published by the Free
  35. Software Foundation; either version 2 of the License, or (at your
  36. option) any later version.  This library is distributed in the hope
  37. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  38. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  39. PURPOSE.  See the GNU Library General Public License for more details.
  40. You should have received a copy of the GNU Library General Public
  41. License along with this library; if not, write to the Free Software
  42. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  43. */
  44.  
  45. /*
  46.  *  Please check the following before installing this file:
  47.  *
  48.  *  Make sure USG is #defined if you are on a USG system!
  49.  *
  50.  *  Check whether your libc.a sprintf function returns
  51.  *  an int (as do most) versus a char* (BSD), and (un)comment
  52.  *  the corresponding SPRINTF_RETURNS_INT line.
  53.  *
  54.  *  Check the value of BUFSIZ against the one in your /usr/include/stdio.h.
  55.  *
  56.  *  Carefully check the fields and order of _iobuf declaration against
  57.  *  the one in your /usr/include/stdio.h. Xenix-based systems
  58.  *  may need some re-ordering of _iobuf. fields.
  59.  *
  60.  *  Note that some _IOXXX #defines may not be present in your 
  61.  *  /usr/include/stdio.h. This is ok, so long as the ones that
  62.  *  are present in both are set to the same values.
  63.  *
  64.  *  Some of the prototypes refer to functions that may not be
  65.  *  present in your libc.a. This is ok so long as you do not
  66.  *  actually call such functions.
  67.  *
  68.  */
  69.  
  70. #ifndef _stdio_h
  71. #ifdef __GNUG__
  72. #pragma interface
  73. #endif
  74.  
  75. #ifdef __stdio_h_recursive
  76. #include_next <stdio.h>
  77. #else
  78. #define __stdio_h_recursive
  79.  
  80. // Note:  The #define _stdio_h is at the end of this file,
  81. // in case #include_next <stdio.h> finds an installed version of this
  82. // same file -- we want it to continue until it finds the C version.
  83.  
  84. #ifdef SYSTEM_FIVE
  85. #define USG
  86. #endif
  87.  
  88. #if defined(IBM6000)
  89. #define NO_LIBGXX_MALLOC
  90. #endif    // IBM6000
  91.  
  92. #if defined(USG)
  93.  
  94. #elif defined(VMS)
  95. #define NO_LIBGXX_MALLOC
  96.  
  97. #elif masscomp
  98. #ifdef _ATT
  99. #define USG
  100. #endif
  101.  
  102. #elif defined(DGUX)
  103. #define SPRINTF_RETURNS_INT
  104. #define USG
  105.  
  106. #elif defined(TEKTRONIX_SYSV) || defined(hp9000s300) || defined(i386)
  107. #define  USG
  108. #endif
  109.  
  110. extern "C" {
  111.  
  112. #undef NULL
  113.  
  114. #define fdopen __hide_fdopen
  115. #define fopen __hide_fopen
  116. #define fprintf __hide_fprintf
  117. #define fputs __hide_fputs
  118. #define freopen __hide_freopen
  119. #define fscanf __hide_fscanf
  120. #define fwrite __hide_fwrite
  121. #define new __hide_new /* In case 'new' is used as a parameter name. */
  122. #define perror __hide_perror
  123. #define popen __hide_popen
  124. #define printf __hide_printf
  125. #define puts __hide_puts
  126. #define putw __hide_putw
  127. #define rewind __hide_rewind
  128. #define tempnam __hide_tempnam
  129. #define scanf __hide_scanf
  130. #define setbuf __hide_setbuf
  131. #define setlinebuf __hide_setlinebuf
  132. #define setvbuf __hide_setvbuf
  133. #define sprintf __hide_sprintf
  134. #define sscanf __hide_sscanf
  135. #define tempnam __hide_tempnam
  136. #define vfprintf __hide_vfprintf
  137. #define vprintf __hide_vprintf
  138. #define vsprintf __hide_vsprintf
  139.  
  140. #include_next <stdio.h>
  141.  
  142. #undef fdopen
  143. #undef fopen
  144. #undef fprintf
  145. #undef fputs
  146. #undef freopen
  147. #undef fscanf
  148. #undef fwrite
  149. #undef new
  150. #undef perror
  151. #undef popen
  152. #undef printf
  153. #undef puts
  154. #undef putw
  155. #undef rewind
  156. #undef tempnam
  157. #undef scanf
  158. #undef setbuf
  159. #undef setlinebuf
  160. #undef setvbuf
  161. #undef sprintf
  162. #undef sscanf
  163. #undef tempnam
  164. #undef vprintf
  165. #undef vfprintf
  166. #undef vsprintf
  167.  
  168. #ifndef NULL
  169. #define NULL ((void*)0)
  170. #endif
  171. }
  172.  
  173. #ifndef __SIZE_TYPE__ /* Defined by gcc-2. */
  174. #define __SIZE_TYPE__ long unsigned int
  175. #endif
  176.  
  177. extern "C" {
  178.  
  179. #ifdef VMS
  180. int     c$$doprint(const char*, void*, FILE*);
  181. int     c$$doscan(FILE*, const char*, ...);
  182. int    c$$filbuf(FILE*);
  183. int    c$$flsbuf(unsigned, FILE*);
  184. #elif ! defined(ultrix)
  185. int    _doprnt(const char*, void*, FILE*);
  186. int    _doscan(FILE*, const char*, ...);
  187. int    _filbuf(FILE*);
  188. int    _flsbuf(unsigned, FILE*);
  189. #endif
  190.  
  191. int    fclose(FILE*);
  192. FILE*  fdopen(int, const char*);
  193. int    fflush(FILE*);
  194. int    fgetc(FILE*);
  195. char*  fgets(char*, int, FILE *);
  196. FILE*  fopen(const char*, const char*);
  197. int    fprintf(FILE*, const char* ...);
  198. int    fputc(int, FILE*);
  199. int    fputs(const char*, FILE*);
  200. __SIZE_TYPE__ fread(void*, __SIZE_TYPE__, __SIZE_TYPE__, FILE*);
  201. #ifdef VMS
  202. FILE*  freopen(const char*, const char*, FILE* ...);
  203. #else
  204. FILE*  freopen(const char*, const char*, FILE*);
  205. #endif
  206. int    fscanf(FILE*, const char* ...);
  207. int    fseek(FILE*, long, int);
  208. long   ftell(FILE *);
  209. __SIZE_TYPE__ fwrite(const void*, __SIZE_TYPE__, __SIZE_TYPE__, FILE*);
  210. char*  gets(char*);
  211. int    getw(FILE*);
  212. int    pclose(FILE*);
  213. void   perror(const char*);
  214. FILE*  popen(const char*, const char*);
  215. int    printf(const char* ...);
  216. int    puts(const char*);
  217. int    putw(int, FILE*);
  218. void    rewind(FILE*);
  219. int    scanf(const char* ...);
  220. void    setbuf(FILE*, char*);
  221. void    setbuffer(FILE*, char*, int);
  222. int    setlinebuf(FILE*);
  223. int    setvbuf(FILE*, char*, int, __SIZE_TYPE__);
  224. int    sscanf(char*, const char* ...);
  225. FILE*  tmpfile();
  226. int    ungetc(int, FILE*);
  227. int    vfprintf(FILE*, const char*, ...);
  228.  
  229. // Third arg to vprintf must be '...' for some machines, & doesn't
  230. // hurt for others.
  231.  
  232. int    vprintf(const char*, ... );
  233.  
  234. #ifdef SPRINTF_RETURNS_INT
  235. int    sprintf(char*, const char* ...);
  236. int    vsprintf(char*, const char*, ...);
  237. #else
  238. char*  sprintf(char*, const char*, ...);
  239. char*  vsprintf(char*, const char*, ...);
  240. #endif
  241.  
  242. }
  243.  
  244. #ifndef L_ctermid
  245. #define L_ctermid    9 
  246. #endif
  247. #ifndef L_cuserid
  248. #define L_cuserid    9
  249. #endif
  250. #ifndef P_tmpdir
  251. #define    P_tmpdir    "/usr/tmp/"
  252. #endif
  253. #ifndef L_tmpnam
  254. #define    L_tmpnam    (sizeof(P_tmpdir) + 15)
  255. #endif
  256.  
  257. #define _stdio_h 1
  258.  
  259. #endif
  260. #endif // _stdio_h
  261.  
  262. The other stdio.h, included by this file is the standard Ultrix 4.2
  263. stdio.h file.  I cannot include it here since it is copyright DEC.
  264.  
  265. The program was compiled on a MIPS machine running Ultrix 4.2.
  266. --
  267. ---------------------------------------------+ "A tight hat can be stretched.
  268. Pete Chown, pc123@phx.cam.ac.uk (Internet)   |  First damp the head with steam
  269.             pc123@uk.ac.cam.phx (Janet :-)  -+  from a boiling kettle."
  270.  
  271.