Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: g++ and linking Date: Mon, 25 Apr 2022 07:19:47 -0700 Organization: A noiseless patient Spider Lines: 58 Message-ID: <86bkwp8cu4.fsf@linuxsc.com> References: <86wnielipg.fsf@linuxsc.com> <206e9608-9929-4652-a7f1-0b43f1069896n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="2b2bd3060d7fb14ae545fc6b32585799"; logging-data="17399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y5iZ+3pU5hLto4SdD3VSCLNMuws6cPoE=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:lf+es8bodWLp6aL9V+BL2/2pKV0= sha1:nHwA5E8Ef6YqUOPELLuCpOzhrX0= Xref: csiph.com comp.lang.c++:83725 "james...@alumni.caltech.edu" writes: > On Tuesday, February 1, 2022 at 10:18:25 AM UTC-5, Tim Rentsch wrote: > >> Richard Damon writes: >> >> [...] >> >>> The early versions of the standard, while not limiting identifier >>> length, does limit the 'significant' length for external identifiers, >>> allowing the implementation to truncate the name of the symbol in the >>> output to the linker. >>> >>> In C99, 6.4.2.1p5 makes that length Implementation Defined. I would >>> have to search to see if somewhere there is a guarantee of a minimum >>> value for this length >> >> Section 5.2.4.1 paragraph 1 says > > "The implementation shall be able to translate and execute at > least one program that contains at least one instance of every one > of the following limits:" > >> 63 significant initial characters in an internal identifier >> or a macro name >> >> 31 significant initial characters in an external identifier > > Keep in mind that these are NOT minimum permitted values for the > maximum number of significant characters in an identifier (the > so-called minimum maximum that I heard a lot about when C90 first > came out). Strictly speaking, the only requirement that they > impose is on the "one program". It is not a requirement that the > implementation treat that many characters as significant if they > occur in any other program I think you're just wrong about that. Clearly the intended reading of section 5.2.4, and how essentially everyone else reads this section, is that 5.2.4.1 paragraph 1 gives minimum translation limits, and also requires all conforming implementations to be able to translate *and execute* a program that has at least one instance of each of the minimums. Conversely, any programming language standard that does not give a requirement for minimum supported identifier length would be grossly negligent. So it would be quite astonishing to interpret 5.2.4.1 paragraph 1 as giving minimums that apply to just the one program rather than stating minimum requirements that apply to the implementation generally. >> By the way I think you mean requirement rather than guarantee. > > A requirement that must be met by an implementation of a language in > order to qualify as conforming to a given standard also serves as a > guarantee that anything that does qualify as conforming > implementation of that language meets that requirement. It is not a guarantee in the usual sense of the word guarantee. And even if it were, it's a pointless observation.