lua-users home
lua-l archive

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


Paige DePol <lual@serfnet.org> wrote:

> typedef const char* l_str

Nobody has an opinion on this style of typedef? 

The question may seem noob'ish, but really I am just curious if
anyone else uses a typedef like this or if I am violating some
sort of unwritten rule when coding in C.

Hacking on Lua has been a lot of fun, but is also a return to
the C language to me, so I am not necessarily up to speed with
all the things you should and shouldn't do.

My online searching seems to go both ways with people saying it
is fine and others saying it is a horrible thing to do. Mostly
people are against hiding pointers, but as C strings are just
pointers to arrays of 'const char' I guess I don't see hiding
the pointer as being a major issue.

I have converted my codebase to use it, and I do like it, I
was just wondering if this is something that other developers
will take one look at and curse me for doing it? I do get the
impression this may just one of those style things, like where
you place opening braces and the like.

~Paige