A commandline tool for eliminating superfluous preprocessor clutter from C and C++ source files.
Be the first to post a text review of Sunifdef. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Six bugs are fixed in this release. Five of these fixes tackle longstanding defects of sunifdef's parsing and evaluation of integer constants - a niche that has received little scrutiny since the tool branched from unifdef. This version provides robust parsing of hex, decimal and octal numerals and arithmetic on them, plus safe integer overflow handling. However, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic uponthem. This still falls short of emulating the C preprocessor's arithmetic fully, which is an unfixed defect.
sunifdef v3.1.3 Mike Kinghan 2008-01-19 *Fix: DEF0041: When -DSYM=VAL is specified with VAL a hex integer constant, rather than a decimal constant, sunifdef would fail to resolve SYM in expressions unless the --constant eval was specified, which should be unnecessary. The anomaly ocurred because eval_symbol() anticipated constant values only as decimal constants and, upon encountering a hex-prefix "0x" or "OX" would attempt to parse the token as an expression, invoking eval_table() and ultimately eval_unary(). The latter function _would_ resolve a hex constant, but only if --constant eval is in effect, since the function is assumed to operate on source text rather than on the definiens of -DSYM=VAL. The fix consists in recognising hex constants as such in eval_symbol(). *Fix: DEF0042: When -DSYM=VAL is specified with VAL a soluble expression containing at least one integer constant operand, sunifdef would fail to resolve SYM in expressions unless --constant eval was specified. The reason is the same as in bug DEF0041. The fix consists in recording the origin of the text upon which eval_unary() is called - source text or else the definiens of a --defined symbol - and always resolving integer contstants in the latter case. *Fix: DEF0043: sunifdef did not distinguish octal numerals as integer constants and evaluated them as decimal numerals. *Fix: DEF0044: sunifdef did not recognise the suffixes u/U, l/L as belonging to integer constants. These suffixes are now recognised; however, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic upon them. This is unfixed bug. *Fix: DEF0045: sunifdef did not detect integer overflow in evaluating constants. Now detects overflow whenever the value of a constant will exceed INT_MAX and leaves the constant unresolved with a warning to that effect. *Fix: DEF0046: The --help message contained an occurrence of '--constants' that ought to have been '--constant'.
sunifdef v3.1.3 Mike Kinghan 2008-01-19 *Fix: DEF0041: When -DSYM=VAL is specified with VAL a hex integer constant, rather than a decimal constant, sunifdef would fail to resolve SYM in expressions unless the --constant eval was specified, which should be unnecessary. The anomaly ocurred because eval_symbol() anticipated constant values only as decimal constants and, upon encountering a hex-prefix "0x" or "OX" would attempt to parse the token as an expression, invoking eval_table() and ultimately eval_unary(). The latter function _would_ resolve a hex constant, but only if --constant eval is in effect, since the function is assumed to operate on source text rather than on the definiens of -DSYM=VAL. The fix consists in recognising hex constants as such in eval_symbol(). *Fix: DEF0042: When -DSYM=VAL is specified with VAL a soluble expression containing at least one integer constant operand, sunifdef would fail to resolve SYM in expressions unless --constant eval was specified. The reason is the same as in bug DEF0041. The fix consists in recording the origin of the text upon which eval_unary() is called - source text or else the definiens of a --defined symbol - and always resolving integer contstants in the latter case. *Fix: DEF0043: sunifdef did not distinguish octal numerals as integer constants and evaluated them as decimal numerals. *Fix: DEF0044: sunifdef did not recognise the suffixes u/U, l/L as belonging to integer constants. These suffixes are now recognised; however, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic upon them. This is unfixed bug. *Fix: DEF0045: sunifdef did not detect integer overflow in evaluating constants. Now detects overflow whenever the value of a constant will exceed INT_MAX and leaves the constant unresolved with a warning to that effect. *Fix: DEF0046: The --help message contained an occurrence of '--constants' that ought to have been '--constant'.
sunifdef v3.1.3 Mike Kinghan 2008-01-19 *Fix: DEF0041: When -DSYM=VAL is specified with VAL a hex integer constant, rather than a decimal constant, sunifdef would fail to resolve SYM in expressions unless the --constant eval was specified, which should be unnecessary. The anomaly ocurred because eval_symbol() anticipated constant values only as decimal constants and, upon encountering a hex-prefix "0x" or "OX" would attempt to parse the token as an expression, invoking eval_table() and ultimately eval_unary(). The latter function _would_ resolve a hex constant, but only if --constant eval is in effect, since the function is assumed to operate on source text rather than on the definiens of -DSYM=VAL. The fix consists in recognising hex constants as such in eval_symbol(). *Fix: DEF0042: When -DSYM=VAL is specified with VAL a soluble expression containing at least one integer constant operand, sunifdef would fail to resolve SYM in expressions unless --constant eval was specified. The reason is the same as in bug DEF0041. The fix consists in recording the origin of the text upon which eval_unary() is called - source text or else the definiens of a --defined symbol - and always resolving integer contstants in the latter case. *Fix: DEF0043: sunifdef did not distinguish octal numerals as integer constants and evaluated them as decimal numerals. *Fix: DEF0044: sunifdef did not recognise the suffixes u/U, l/L as belonging to integer constants. These suffixes are now recognised; however, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic upon them. This is unfixed bug. *Fix: DEF0045: sunifdef did not detect integer overflow in evaluating constants. Now detects overflow whenever the value of a constant will exceed INT_MAX and leaves the constant unresolved with a warning to that effect. *Fix: DEF0046: The --help message contained an occurrence of '--constants' that ought to have been '--constant'.
sunifdef v3.1.3 Mike Kinghan 2008-01-19 *Fix: DEF0041: When -DSYM=VAL is specified with VAL a hex integer constant, rather than a decimal constant, sunifdef would fail to resolve SYM in expressions unless the --constant eval was specified, which should be unnecessary. The anomaly ocurred because eval_symbol() anticipated constant values only as decimal constants and, upon encountering a hex-prefix "0x" or "OX" would attempt to parse the token as an expression, invoking eval_table() and ultimately eval_unary(). The latter function _would_ resolve a hex constant, but only if --constant eval is in effect, since the function is assumed to operate on source text rather than on the definiens of -DSYM=VAL. The fix consists in recognising hex constants as such in eval_symbol(). *Fix: DEF0042: When -DSYM=VAL is specified with VAL a soluble expression containing at least one integer constant operand, sunifdef would fail to resolve SYM in expressions unless --constant eval was specified. The reason is the same as in bug DEF0041. The fix consists in recording the origin of the text upon which eval_unary() is called - source text or else the definiens of a --defined symbol - and always resolving integer contstants in the latter case. *Fix: DEF0043: sunifdef did not distinguish octal numerals as integer constants and evaluated them as decimal numerals. *Fix: DEF0044: sunifdef did not recognise the suffixes u/U, l/L as belonging to integer constants. These suffixes are now recognised; however, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic upon them. This is unfixed bug. *Fix: DEF0045: sunifdef did not detect integer overflow in evaluating constants. Now detects overflow whenever the value of a constant will exceed INT_MAX and leaves the constant unresolved with a warning to that effect. *Fix: DEF0046: The --help message contained an occurrence of '--constants' that ought to have been '--constant'.
sunifdef v3.1.3 Mike Kinghan 2008-01-19 *Fix: DEF0041: When -DSYM=VAL is specified with VAL a hex integer constant, rather than a decimal constant, sunifdef would fail to resolve SYM in expressions unless the --constant eval was specified, which should be unnecessary. The anomaly ocurred because eval_symbol() anticipated constant values only as decimal constants and, upon encountering a hex-prefix "0x" or "OX" would attempt to parse the token as an expression, invoking eval_table() and ultimately eval_unary(). The latter function _would_ resolve a hex constant, but only if --constant eval is in effect, since the function is assumed to operate on source text rather than on the definiens of -DSYM=VAL. The fix consists in recognising hex constants as such in eval_symbol(). *Fix: DEF0042: When -DSYM=VAL is specified with VAL a soluble expression containing at least one integer constant operand, sunifdef would fail to resolve SYM in expressions unless --constant eval was specified. The reason is the same as in bug DEF0041. The fix consists in recording the origin of the text upon which eval_unary() is called - source text or else the definiens of a --defined symbol - and always resolving integer contstants in the latter case. *Fix: DEF0043: sunifdef did not distinguish octal numerals as integer constants and evaluated them as decimal numerals. *Fix: DEF0044: sunifdef did not recognise the suffixes u/U, l/L as belonging to integer constants. These suffixes are now recognised; however, sunifdef still evaluates all integer constants as ints and performs signed integer arithmetic upon them. This is unfixed bug. *Fix: DEF0045: sunifdef did not detect integer overflow in evaluating constants. Now detects overflow whenever the value of a constant will exceed INT_MAX and leaves the constant unresolved with a warning to that effect. *Fix: DEF0046: The --help message contained an occurrence of '--constants' that ought to have been '--constant'.
Be the first person to add a text review.
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?
Thanks for your review!
Get credit for your review by logging in via OpenID. Click your account provider: