Did the limit in C used to be 5 characters?  That would explain "creat()".

(That's a bit of trivia I've always wondered about)

Tom


On Wed, Apr 5, 2017 at 9:16 AM, Ian Lance Taylor <i...@golang.org> wrote:
> On Wed, Apr 5, 2017 at 3:57 AM, Jan Mercl <0xj...@gmail.com> wrote:
>> On Wed, Apr 5, 2017 at 12:23 PM <wei.x...@arm.com> wrote:
>>
>>> But i don't find such specification for Golang.Is there any limit on the
>>> length of an identifier in Golang?
>>
>> The lack of a specified limit implies no limit other than resources
>> available to the compiler and/or the program.
>
> Yes.
>
> Also, that's not precisely what the ISO C standard says.  What it says
> is that every C compiler must accept programs that use identifiers
> that do not differ in the first 31 characters.  It doesn't say that
> the compiler must treat identifiers whose first 32 characters are the
> same as being the same.  In practice modern C compilers also have no
> limit on identifier length.
>
> (Historically the limits on C identifier length have been imposed not
> by compilers but by object file formats.  Compilers have historically
> had no limits on identifier length for internal identifiers but when
> generating object files have been forced to limit external identifiers
> to the length permitted by the object file format.  Modern object file
> formats (ELF, PE/COFF) have no limits on identifier length, which is a
> requirement for even relatively simple C++ programs.)
>
> Ian
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Email: t...@whatexit.org    Work: tlimonce...@stackoverflow.com
Blog:  http://EverythingSysadmin.com

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to