-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various cpp fixes for Sun /usr/lib/cpp compatibility #12
base: master
Are you sure you want to change the base?
Commits on Sep 21, 2013
-
[HACK] cpp: add some simple test tools
- test.sh: run /usr/lib/cpp and ./cpp against either specified headers, or all (most) headers in /usr/include, and report on differences. - squash.py: coalesce the results of test.sh (expected on stdin), so each diff hunk is reported only once (line numbers are ignored, context is not)
Configuration menu - View commit details
-
Copy full SHA for 5825a37 - Browse repository at this point
Copy the full SHA 5825a37View commit details -
[HACK] cpp: make it easier to find macro sources
This is a dubiously useful hack, but invaluable when debugging the preprocessor. If CPP_DEBUG_DEFINITIONS is in the environment, output to stderr at every macro definition its name, and the defining file and line number, such that the operative definition of common macros (such as __P) can be determined.
Configuration menu - View commit details
-
Copy full SHA for 61d063c - Browse repository at this point
Copy the full SHA 61d063cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b6857d2 - Browse repository at this point
Copy the full SHA b6857d2View commit details -
cpp: squash spaces correctly-ish whilst pasting macros
Sun cpp removes all leading and trailing space from a macro pasting, and compress whitespace in the macro body to a single space character. There is some deviation from this in the Sun implementation which we don't duplicate. 1) The presence of comments in the macro body affect the minimization of runs of spaces. 2) When newlines are encountered in the parameter list of a macro invocation, Sun cpp inserts that many newlines prior to any of the pasted text, and then in the pasted text pastes those newlines as (minimized) spaces. Escaped new-lines are de-escaped, and otherwise treated similarly (in effect, the \ is removed).
Configuration menu - View commit details
-
Copy full SHA for d86b945 - Browse repository at this point
Copy the full SHA d86b945View commit details -
Configuration menu - View commit details
-
Copy full SHA for 76ccafe - Browse repository at this point
Copy the full SHA 76ccafeView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea5ba79 - Browse repository at this point
Copy the full SHA ea5ba79View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2ee643 - Browse repository at this point
Copy the full SHA d2ee643View commit details -
cpp: only consider macro calls unterminated if they ever began
We should only error about an unterminated macro parameter list if a parameter list was begun. If we never even seen the _first_ parenthesis, there is nothing to terminate. Previously, we would set the parenthesis level to -1 when expecting parameters (such that when we saw the opening paren it became the 0th level), but when checking for unterminated expansion we would strictly compare to 0, and thus flag a macro which needed parameters but lacked them as having an unterminated parameter list.
Configuration menu - View commit details
-
Copy full SHA for cf28293 - Browse repository at this point
Copy the full SHA cf28293View commit details -
cpp: if a macro with parameters is invoked without any, don't destroy…
… state Previously, we would parse a macro foo() presuming that we would always see the opening parenthesis indicating the begining of the parameter list. If we saw 'foo' we would consume the token _following_ 'foo' presuming it would be the parenthesis, and if it was not, would not paste it to the output.
Configuration menu - View commit details
-
Copy full SHA for b376914 - Browse repository at this point
Copy the full SHA b376914View commit details -
cpp: allow vastly more #defines
<inet/tcp.h> requires considerably more defines to preprocess than the 4,000 we previously allowed. Allow an (equally arbitrary) 16,000 symbols instead.
Configuration menu - View commit details
-
Copy full SHA for 017b97d - Browse repository at this point
Copy the full SHA 017b97dView commit details -
cpp: don't handroll an incorrect strtoul(3c), use the one in libc
The previous implementation would parse 0x7ff as 0x755 (etc).
Configuration menu - View commit details
-
Copy full SHA for 20da04f - Browse repository at this point
Copy the full SHA 20da04fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d362662 - Browse repository at this point
Copy the full SHA d362662View commit details