N2324: SD3#13 (DR 482): Macro invocation span two files


Submitter:Fred Tydeman
Submission Date: 2018年12月12日
Document: WG14 N2324
Reference Documents: N1942

Summary

SD3 item 13 (DR 482) against C2X: Macro invocation span files.

It was decided that DR 482 would be fixed in C2X as undefined behaviour.

Possible Technical Corrigendum:

  1. Add to §5.1.1.2 (Translation phases), paragraph 1, bullet 3, words along the lines of:

    (追記) A macro invocation shall be contained within one source file. (追記ここまで)
  2. Add after §6.10.3 (Macro replacement), paragraph 6 (constraints), a new paragraph:

    (追記) A macro invocation shall be contained within one source file. (追記ここまで)
  3. Add after §6.10.3 (Macro replacement), paragraph 12 (semantics), a new paragraph:

    (追記) A macro invocation that spans two or more files is undefined behavior. (追記ここまで)

Add to J.2 Undefined behavior

(追記) A macro invocation that spans two or more files is undefined behavior. (追記ここまで)

Existing practice

Some implementations accept (as required by all previous versions of the C standard) a macro invocation that is split between two or more files. Other implementations, consider it a translation error and will not compile such code. Making this undefined allows both sets of implementations to conform. This is a silent change.

AltStyle によって変換されたページ (->オリジナル) /