[PATCH 6/7] RISC-V: use is_whitespace()

Nelson Chu nelson@rivosinc.com
Wed Aug 21 08:37:19 GMT 2024


umm I apply the patch and then get the following errors,
error: call to undeclared function 'is_whitespace'; ISO C99 and later do
not support implicit function declarations

Personally, also considering the file compatibility, maybe ISSPACE is a
good way to go.  But if the above error can be resolved, in fact both look
better then the old code.

Thanks
Nelson

On Tue, Aug 20, 2024 at 3:13 PM Jan Beulich <jbeulich@suse.com> wrote:

> On 20.08.2024 03:44, Nelson Chu wrote:
> > Looks good, thanks.
>
> No opinion then on is_whitespace() vs ISSPACE()?
>
> Jan
>
> > On Fri, Aug 9, 2024 at 8:55 PM Jan Beulich <jbeulich@suse.com> wrote:
> >
> >> Wherever blanks are permissible in input, tabs ought to be permissible,
> >> too. This is particularly relevant when -f is passed to gas (alongside
> >> appropriate input). Switch places already checking for tabs to use the
> >> macro, too. Note however that elsewhere in the file ISSPACE() is also
> >> used; probably the file should be consistent either way.
> >>
> >> --- a/gas/config/tc-riscv.c
> >> +++ b/gas/config/tc-riscv.c
> >> @@ -2505,7 +2505,7 @@ my_getSmallExpression (expressionS *ep,
> >>
> >>        /* Skip over whitespace and brackets, keeping count of the number
> >>          of brackets.  */
> >> -      while (*str == ' ' || *str == '\t' || *str == '(')
> >> +      while (is_whitespace (*str) || *str == '(')
> >>         if (*str++ == '(')
> >>           str_depth++;
> >>      }
> >> @@ -2534,7 +2534,7 @@ my_getSmallExpression (expressionS *ep,
> >>    probing_insn_operands = orig_probing;
> >>
> >>    /* Match every open bracket.  */
> >> -  while (crux_depth > 0 && (*str == ')' || *str == ' ' || *str ==
> '\t'))
> >> +  while (crux_depth > 0 && (*str == ')' || is_whitespace (*str)))
> >>      if (*str++ == ')')
> >>        crux_depth--;
> >>
> >> @@ -3480,7 +3480,7 @@ riscv_ip (char *str, struct riscv_cl_ins
> >>               if (reg_lookup (&asarg, RCLASS_GPR, &regno))
> >>                 {
> >>                   char c = *oparg;
> >> -                 if (*asarg == ' ')
> >> +                 if (is_whitespace (*asarg))
> >>                     ++asarg;
> >>
> >>                   /* Now that we have assembled one operand, we use the
> >> args
> >> @@ -3514,7 +3514,7 @@ riscv_ip (char *str, struct riscv_cl_ins
> >>                               ? RCLASS_GPR : RCLASS_FPR), &regno))
> >>                 {
> >>                   char c = *oparg;
> >> -                 if (*asarg == ' ')
> >> +                 if (is_whitespace (*asarg))
> >>                     ++asarg;
> >>                   switch (c)
> >>                     {
> >>
> >>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20240821/94fdfecb/attachment.htm>


More information about the Binutils mailing list