Re: [patch] Backtrace prints wrong argument value

Pedro Alves
2007-10-24T22:14:36Z

Daniel Jacobowitz wrote:

> With Pedro's help, two are now fixed. Only build/2339 remains. But
> that's with SunPro and I don't think it's a blocker - so we are
> probably good to go now.
>

Irk. I've seen that happen too a few months ago, but totally forgot
about it. That happens due to the your's trully and Nick's
new STRING_COMMA_LEN in bfd.

bfd-in.h:#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)

SunPro doesn't like the '?' operator for constant initilizers.

elf.c", line 856: non-constant initializer: op "?"

The fix is easy - inline the STRING_COMMA_LEN(NULL) cases.
Wait, a quick 'grep STRING_COMMA_LEN * -rn | grep NULL' shows
there aren't any?

This should fix it. I'll see if I can give it a spin with SunPro this week, but
no promises.

-#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
+#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)

Cheers,
Pedro Alves