From: Daniel J. <dan...@gm...> - 2017-03-23 20:43:28
|
Hi Sam, > we need either a comment or a thorough purge. > I favor the latter because I want the CLISP sources to _look_ like > regular C. Me too. Though I got the impression from our discussions last year that a full purge - due to the massive commit this would cause - is not wanted. That's why I went the `#define var` way. > Note that the purge can be done with a perl one-liner. Yes, but bear in mind that the purge is only the first step. Removing var causes problems. In the second patch of the original mail I only corrected those which caused compile errors for my configuration. There are possibly many more of them when looking through all the code. Examples: A declaration cannot immediately follow an label. There are LOTS of those errors. Example: label: var type name; I solved this like so: label:; var type name; > No, please add braces instead. This might work in some cases, but most of the affected code is highly "unstructured". If I could easily add braces without rewritting it, then there wouldn't be labels and gotos but if, while and friends. I tried to find more instances of those with: find src -type f -name '*.d' -exec \ pcregrep -MHno \ '[[:alnum:]]+:([^:;{]|\n)*?var([^;]|\n)*+;' '{}' ';' \ 2>/dev/null \ | sed 's_^src/_\x0src/_g' \ | grep -z -v -F ': */' \ | less But this shows many false positives... Another issue is conflicting definitions of the same variable. Example: var type1 foo; // some code var type2 foo; This is solved by renaming one of them, if possible. In two places, I manually added braces (like varbrace would've done), specifically in src/intlog.d, function I_logcount_I, the variables with the name (as written in the source code) "x16". The issue is that "x16" might be "#define" to something else, and I didn't exactly understood why and when. > Please either make a separate patch or tell me where the unused var is. I attached a patch with the small change (including an entry in the changelog, just to be sure ;) ) > I will let Bruno decide on this. Bruno, what do you think? |