lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 6 February 2018 at 03:21, Paige DePol <lual@serfnet.org> wrote:
> The idea of saving space was not in terms of physical space on media, but
> rather that of source code line length. Also, typing "ccstr" is just faster
> than typing "const char *" all the time as well... coders are often lazy! ;)

I would not use a typedef for `const char*`:

  - A *huge* number of APIs take a const char*, including C standard library
    functions e.g. strlen, strcmp, fopen
  - char* (and variants) have a special exclusion from C aliasing rules: it's
    important to know when something is only accessed normally as a char*.
  - I'm not concerned about line length very much. I can fit 3 120 column
    terminals side by side on my screen...