Re: K&R Exercise 6-2



Harald van Dijk wrote:
On Fri, 29 Aug 2008 16:51:56 +0200, August Karlstrom wrote:
Richard Heathfield wrote:
[...]
In C90, an implementation must be able to distinguish between external
identifiers that are unique in the first 6 characters (without regard
to case!). A program such as the one required in Exercise 6-2 could be
useful for diagnosing source code that ignores this limit (as I suspect
a vast amount of source code does).
So a library which exports e.g. the identifiers string_prepend and
string_append are not really C90 compliant?

Correct. However, they are already not C90 compliant -- and not C99 compliant either -- for another reason: external identifiers starting with str and followed by a lowercase letter are reserved for the implementation.

Annoying. Is there a way to make a compiler like GCC emit a warning in this case?


August
.



Relevant Pages

  • Re: Onclick and DOM problem
    ... meaning so that source code would become easier to maintain. ... Using `var1' and `var2' as identifiers for named arguments is syntactically ... a single space in between either changes the meaning (in the function ... You want to make this a call instead of an assignment at first, ...
    (comp.lang.javascript)
  • Re: Newbie Question: Is it allowed for the function to change the value of parameters?
    ... identifiers of a form that cannot appear in source code. ... That's rather a grim solution, ... I think you can always avoid it with ...
    (comp.lang.functional)
  • Re: Style, or lack thereof in Grahams ANSI CL
    ... of language design that was opposed to CL. ... From long identifiers vs. ... design a language -> Arc. ... arc example source code. ...
    (comp.lang.lisp)
  • Re: Identifier like "_", "$", etc.
    ... The javascript engine has no way of knowing how the source code it is presented with is generated, so know way of determining which, if any, of it has been machine generated. ... One of the issues you get with machine generated Identifiers is that it can be difficult to predict exactly which Identifiers will be generated, and so guaranteed that they will not collide with Identifiers already in use in the human generated code. ... spaces and tabs were allowed. ...
    (comp.lang.javascript)
  • Re: malloc vs. realloc
    ... >> the end of your identifiers?). ... or modify the source code accordingly. ... >distinguishing the purpose of the functions to the beginning of the ... Dan Pop ...
    (comp.lang.c)