This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve gen-libm-test.pl LIT() application
On Thu, 4 Aug 2016, Paul E. Murphy wrote:
> As I understand it, the only incorrect splitting occurs for
> some inputs of the form:
>
> {integer, identifier} op {integer,real}
>
> Which, will ultimately only apply LIT() to the expressions
> containing a real value as the second operand. But, LIT is
> applied to the entire expression.
>
> So you might end up passing things like "MAX_EXP+1", "0xe+1.0f"
> to _apply_lit. The former does happen, the latter is a
> constructed example.
>
> If more complicated expressions are used in libm-test.inc, or
> this workaround proven insufficient, we should refactor
> libm-test.inc to remove the need for this hack.
How about putting spaces around the operators in libm-test.inc in all
cases where you need to split on operators, and then making the code split
on spaces rather than needing to do more complicated lexing and
substitutions to identify tokens? Spaces should be present anyway in
accordance with the GNU Coding Standards.
--
Joseph S. Myers
joseph@codesourcery.com