This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: coding style, continuing education
- To: gcc at gcc dot gnu dot org
- Subject: RE: coding style, continuing education
- From: David Korn <dkorn at pixelpower dot com>
- Date: Wed, 17 Jan 2001 17:57:05 -0000
>-----Original Message-----
>From: Michael Matz [mailto:matzmich@cs.tu-berlin.de]
>Sent: 17 January 2001 17:40
>On Mon, 15 Jan 2001, Mike Stump wrote:
>>
>> If people _know_ of a good way to split this down, maybe we all just
>> need a refresher course on the right way, care to elaborate?
>>
>> [ long expression snipped ]
>
>Even more entertaining is reload.c:push_reload. It has two expressions (in
>if's), 62 and 50 lines long, intersparsed with #ifdef's, so it not even
>fits on one editor page. They have comments in front of them, but it isn't
>exactly easy to at least verify, if these expressions actually do, what
>the comments explain ;-)
You know what would come in handy here? Some kind of automated tool for
processing these messes. I imagine it would have to read in and parse a
bit of C code, building a syntax tree as it went. It could even simplify
the expression somewhat by spotting duplicated subexpressions and
eliminating them, or by applying mathematical transformations and boolean
algebra. Obviously it would have to know all about C types and evaulation
rules, but hopefully it could then output the transformed code in some
simpler format.
Oh. Hold on a minute. We already have one of those...
DaveK
--
The Boulder Pledge: "Under no circumstances will I ever purchase anything
offered to me as the result of an unsolicited email message. Nor will I
forward chain letters, petitions, mass mailings, or virus warnings to large
numbers of others. This is my contribution to the survival of the online
community."
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************