home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18913 < prev    next >
Encoding:
Text File  |  1993-01-10  |  1.7 KB  |  44 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!manuel.anu.edu.au!dubhe.anu.edu.au!csis!mizar!dave
  3. From: dave@mizar.csis.dit.csiro.au (David Campbell)
  4. Subject: Sun C++ 2.1 PIC problem
  5. Message-ID: <1993Jan11.024018.3270@csis.dit.csiro.au>
  6. Sender: dave@mizar (David Campbell)
  7. Nntp-Posting-Host: mizar
  8. Organization: CSIRO Division of Information Technology
  9. Date: Mon, 11 Jan 1993 02:40:18 GMT
  10. Lines: 32
  11.  
  12. /* Here is a program which bombs with a bus error under Sun C++ 2.1 when
  13.  * compiled with the position independant code (PIC) option.
  14.  *
  15.  * I can't get the problem to occur when compiler under C; Sun C++ has its
  16.  * own ccom which must be messed up.
  17.  *
  18.  * Although this program is quite useless as it stands, it is valid C++ and
  19.  * should run.
  20.  *
  21.  * Compile with: CC -PIC -o x x.c
  22.  */
  23.  
  24.  /* x.c */
  25.  
  26. main()
  27. {
  28.         "a"; /* make sure that hello world is misaligned */
  29.         "hello world";
  30. }
  31.  
  32. -- 
  33.   +--------------------------------------------------+-----------------------+
  34.   | Dave Campbell                                    |            UNIX & C++ |
  35.   | Phone: + 61 6 275 0944      Fax: + 61 6 257 1052 |   _--_|\       PLEASE |
  36.   | CSIRO Division of Information Technology         |  /      \             |
  37.   | Centre for Spatial Information Systems           |  \_.--._/ <- Canberra |
  38.   | PO BOX 664                                       |        v              |
  39.   | CANBERRA ACT 2601       +------------------------+                       |
  40.   | AUSTRALIA               | dave@csis.dit.csiro.au |                       |
  41.   +-------------------------+------------------------+-----------------------+
  42.   |                       Get right.....or get left.                         |
  43.   +--------------------------------------------------------------------------+
  44.