home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / linux / 25811 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  3.1 KB

  1. Path: sparky!uunet!pipex!unipalm!uknet!edcastle!dcs.ed.ac.uk!sct
  2. From: sct@dcs.ed.ac.uk (Stephen Tweedie)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: bug in cpp?
  5. Message-ID: <SCT.93Jan28211656@ascrib.dcs.ed.ac.uk>
  6. Date: 28 Jan 93 21:16:56 GMT
  7. References: <1993Jan27.105225.3418@athena.mit.edu>
  8.     <1993Jan27.192855.9198@serval.net.wsu.edu>
  9. Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
  10. Organization: University of Edinburgh Dept. of Computer Science, Scotland
  11. Lines: 64
  12. In-Reply-To: hlu@eecs.wsu.edu's message of 27 Jan 93 19:28:55 GMT
  13.  
  14. In article <1993Jan27.192855.9198@serval.net.wsu.edu>, hlu@eecs.wsu.edu (H.J. Lu) writes:
  15. > In article <1993Jan27.105225.3418@athena.mit.edu>, ludger.kunz@fernuni-hagen.de (Ludger Kunz) writes:
  16. > |> Today i tried to compile gzip-0.8.1. Everything worked fine except for
  17. > |> the assembler file. The file match.S is preprocessed by cpp with
  18. > |> the following command:
  19. > |> /lib/cpp -DUNDERLINE match.S > _match.s
  20.  
  21. It shouldn't.  There is a bug (at least an incompatibility) in 0.8.1
  22. which causes this error, but the configure script ought to catch this
  23. and elect to compile without the optional assembly code file.
  24.  
  25. > |> When trying to compile the _match.s-file with gcc, the following
  26. > |> 2 messages occur:
  27. > |> match.s:51: invalid character '_' in opcode
  28. > |> match.s:63: invalid character '_' in opcode
  29. > |> 
  30. > |> Looking at the file _match.s leads to the lines
  31. > |> 
  32. > |>     _match_init :
  33. > |> and 
  34. > |>     _longest_match :
  35. > |> 
  36. > |> Removing the blank between the label and the colon leads to a successful 
  37. > |> compilation.
  38.  
  39. Indeed.  This is a "feature" of the Linux cpp, and one which I am not
  40. sure is correct: cpp inserts spaces after macro expansions.  Certainly
  41. the sun cpp does not do this.  It also makes it awkward to use cpp to
  42. produce neat human-readable output; you get annoying double spaces
  43. everywhere.
  44.  
  45. HJ, is this correct behaviour?
  46.  
  47. > |> Another bug concerns the following code:
  48. > |>  add     $window+2,%edi
  49. > |> This leads to an error while linking. The symbol window must be replaced with
  50.  
  51. Yup - the gnu cpp allows '$' in identifiers, so it sees the identifier
  52. "$window" rather than "window", and fails to expand it.  I think that
  53. "cpp -$" is supposed to suppress this behaviour.
  54.  
  55. > For gzip-0.8.1 with gcc 2.3.3 + 0.99.4, I did
  56. > configure
  57. > vi Makefile # remove getopt.o which is in libc.a
  58. > make
  59.  
  60. Yes, that should work, but it won't link in the fast 386 assembler
  61. code for the reasons above.
  62.  
  63. I found this bug a couple of days ago, and the gzip maintainer
  64. (Jean-loup Gailly <jloup@fr.chorus>) has fixed it for the next
  65. release, gzip-0.8.2, at an archive site near you now.  (He has
  66. basically worked around the Linux cpp incompatibilities by having
  67. identifiers _with_ underscores by default, which Linux likes, and only
  68. running cpp on the file if it is necessary to remove those
  69. underscores: the opposite of the gzip-0.8.1 behaviour.)  0.8.2 also
  70. fixes the buggette which prevents zcatting .z files with multiple hard
  71. links.  It's worth upgrading.
  72.  
  73. Cheers,
  74.  Stephen Tweedie.
  75. ---
  76. Stephen Tweedie <sct@uk.ac.ed.dcs>   (Internet: <sct@dcs.ed.ac.uk>)
  77. Department of Computer Science, Edinburgh University, Scotland.
  78.