[mythtv] C++ style

Joseph A. Caputo jcaputo1 at comcast.net
Thu Feb 12 13:47:23 EST 2004


On Thursday 12 February 2004 13:06, Dan Conti wrote:
> On Wed, 11 Feb 2004, Daniel Thor Kristjansson wrote:
> > I just saw Ken Thompson yesterday, he invented the ++/-- on the
> > PDP-7 in B. The PDP-7 did not have the PDP-11 auto-increment and
> > auto-decrement address modes, the PDP-11 also did not exist yet.
> > pcc may have implemented x++ as a post-increment, but there were
> > many compilers that didn't do this. Only ++x was defined well until
> > the 80's when ANSI standardization had to deal with the common
> > assumption that x++ was a post-increment. I have used some of these
> > annoying non-ansi compilers working with embedded systems, it ain't
> > fun. If I hadn't lost my copy of the K&R 1st edition I'd look it
> > up.
>
> Funny, i checked my copy of K&R 1st edition last night and it
> specifically describes i++ as being always post increment. It also
> does pointer operations like
>
> *p++ = 0;
>
> Which i doubt they would recommend if postincrement wasn't clearly
> defined. It is possible that there were broken C compilers that did
> not properly implement postincrement, but from K&R on the definition
> is pretty clear.

I think the key to his statement was "1st Edition", which presumably was 
before C was standardized by ANSI.  Most folks probably have a 2nd 
Edition (I do) or later, which bears a big red "ANSI C" stamp on the 
cover.

Anyway, I doubt anyone's trying to build Myth with a non-ANSI C 
compiler.

-JAC



More information about the mythtv-dev mailing list