home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13169 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.8 KB

  1. Path: sparky!uunet!stanford.edu!agate!dog.ee.lbl.gov!horse.ee.lbl.gov!torek
  2. From: torek@horse.ee.lbl.gov (Chris Torek)
  3. Newsgroups: comp.lang.c
  4. Subject: string literal concatenation (was printf question)
  5. Date: 3 Sep 1992 16:01:27 GMT
  6. Organization: Lawrence Berkeley Laboratory, Berkeley
  7. Lines: 26
  8. Message-ID: <26043@dog.ee.lbl.gov>
  9. References: <kimcm.714943581@login.dkuug.dk> <1226@pascal.einstein.eds.com> <RICHARD.92Aug30153124@CLYDE.ttt.kth.se> <3361@dozo.and.nl> <1SEP199221241770@eql.caltech.edu> <MJN.92Sep3000652@pseudo.uucp>
  10. Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
  11. NNTP-Posting-Host: 128.3.112.15
  12.  
  13. In article <1SEP199221241770@eql.caltech.edu> rankin@eql.caltech.edu
  14. (Pat Rankin) writes:
  15. >>Minor quibble:  string concatentation is performed by the compiler,
  16. >>not the preprocessor. ...
  17.  
  18. In article <MJN.92Sep3000652@pseudo.uucp> mjn@pseudo.uucp
  19. (Murray Nesbitt) contends:
  20. >Concatenation of character string literals is performed during the
  21. >preprocessing phase of translation.
  22.  
  23. Both are technically wrong; someone else (I forget who) got it right.
  24. Just for the record, the ANSI C standard (X3.159-1989) does not divide
  25. the task of compilation into `preprocessing' and `compilation' phases
  26. as such.  Rather, it lists *eight* separate phases.  Phase 4 might be
  27. called the `preprocessing' phase, but the standard does not do so.
  28. Syntactic and semantic analysis, which might be called `compilation',
  29. is phase 7.  String literal concatenation occurs in phase 6.
  30.  
  31. Loosely speaking, then, concatenation occurs *between* preprocessing
  32. and compilation, not during either one.
  33.  
  34. We now return you to your regular programming: megabytes of Unix- and
  35. MSDOS-specific news inappropriately directed to a generic C group. :-)
  36. -- 
  37. In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
  38. Berkeley, CA        Domain:    torek@ee.lbl.gov
  39.