Silly brackets (Was: Re: Problems extending Python with C.)

Horst von Brand vonbrand at sleipnir.valparaiso.cl
Sun Feb 20 09:26:45 EST 2000


"Martin v. Loewis" <martin at loewis.home.cs.tu-berlin.de> said:
> > I believed, for years, that C compilers should have an option to
> > emit warning diagnostics when indentation is not consistent with
> > brackets.  It is a big waste, in my opinion, that compilers ignore
> > all that redundancy, while it could be used to better help
> > programmers.

> One of the problems is that C uses a preprocessor, which often does
> funny things to indentation, making the notion of column number
> meaningless to preprocessor output. Combine this with the common
> approach of implementing the preprocessor as a separate process, and
> you'll see that what you want is very hard to implement.

What matters is the source before preprocessing, and there a program like
indent is enough to highlight real structure (and thus expose this class of
bugs), possibly coupled with a diff to the original to find them.
-- 
Horst von Brand                             vonbrand at sleipnir.valparaiso.cl
Casilla 9G, Viña del Mar, Chile                               +56 32 672616





More information about the Python-list mailing list