public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* C99 macros
@ 2012-08-15 17:47 Yufeng Zhang
  2012-08-15 18:27 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Yufeng Zhang @ 2012-08-15 17:47 UTC (permalink / raw)
  To: binutils

Hi,

It has been pointed out that the use of the C99 macros PRIi64 and PRIx64 
(in opcodes/aarch64-opc.c) may cause the build to fail in an environment 
where there is lack of C99 support.

I am considering to eliminate the dependency on this C99 feature by 
replacing PRIi64 and PRIx64 with some alternative approach in the 
AArch64 port.  Before doing that, I wonder what the general policy is 
about coding the binutils using C99 features.  Interestingly, I didn't 
find any other port includes the inttypes.h header file (not to say the 
use of PRIi64 and PRIx64).


Thanks,
Yufeng

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C99 macros
  2012-08-15 17:47 C99 macros Yufeng Zhang
@ 2012-08-15 18:27 ` Mike Frysinger
  2012-08-16 13:44   ` Richard Earnshaw
  2012-08-21 19:20   ` Yufeng Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-08-15 18:27 UTC (permalink / raw)
  To: binutils; +Cc: Yufeng Zhang

[-- Attachment #1: Type: Text/Plain, Size: 953 bytes --]

On Wednesday 15 August 2012 13:17:53 Yufeng Zhang wrote:
> It has been pointed out that the use of the C99 macros PRIi64 and PRIx64
> (in opcodes/aarch64-opc.c) may cause the build to fail in an environment
> where there is lack of C99 support.
> 
> I am considering to eliminate the dependency on this C99 feature by
> replacing PRIi64 and PRIx64 with some alternative approach in the
> AArch64 port.  Before doing that, I wonder what the general policy is
> about coding the binutils using C99 features.  Interestingly, I didn't
> find any other port includes the inttypes.h header file (not to say the
> use of PRIi64 and PRIx64).

we use them in gdb and the sim, although we have gnulib available in the gdb 
subdir.  in general though, i don't see a problem using inttypes.h since glibc 
has had the header since 1997.  wait to see if someone complains.

also, isn't stdint.h and the uint32_t/etc... types technically C99 ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C99 macros
  2012-08-15 18:27 ` Mike Frysinger
@ 2012-08-16 13:44   ` Richard Earnshaw
  2012-08-21 19:20   ` Yufeng Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Earnshaw @ 2012-08-16 13:44 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, Yufeng Zhang

On 15/08/12 18:47, Mike Frysinger wrote:
> On Wednesday 15 August 2012 13:17:53 Yufeng Zhang wrote:
>> It has been pointed out that the use of the C99 macros PRIi64 and
>> PRIx64 (in opcodes/aarch64-opc.c) may cause the build to fail in
>> an environment where there is lack of C99 support.
>> 
>> I am considering to eliminate the dependency on this C99 feature
>> by replacing PRIi64 and PRIx64 with some alternative approach in
>> the AArch64 port.  Before doing that, I wonder what the general
>> policy is about coding the binutils using C99 features.
>> Interestingly, I didn't find any other port includes the
>> inttypes.h header file (not to say the use of PRIi64 and
>> PRIx64).
> 
> we use them in gdb and the sim, although we have gnulib available
> in the gdb subdir.  in general though, i don't see a problem using
> inttypes.h since glibc has had the header since 1997.  wait to see
> if someone complains.
> 
> also, isn't stdint.h and the uint32_t/etc... types technically C99
> ? -mike
> 

Yes, though that then begs the question why, 13 years after c99 was
published, we're still restricting ourselves to a 23-year-old predecessor?

R.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C99 macros
  2012-08-15 18:27 ` Mike Frysinger
  2012-08-16 13:44   ` Richard Earnshaw
@ 2012-08-21 19:20   ` Yufeng Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: Yufeng Zhang @ 2012-08-21 19:20 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils

On 08/15/12 18:47, Mike Frysinger wrote:
> On Wednesday 15 August 2012 13:17:53 Yufeng Zhang wrote:
>> It has been pointed out that the use of the C99 macros PRIi64 and PRIx64
>> (in opcodes/aarch64-opc.c) may cause the build to fail in an environment
>> where there is lack of C99 support.
>>
>> I am considering to eliminate the dependency on this C99 feature by
>> replacing PRIi64 and PRIx64 with some alternative approach in the
>> AArch64 port.  Before doing that, I wonder what the general policy is
>> about coding the binutils using C99 features.  Interestingly, I didn't
>> find any other port includes the inttypes.h header file (not to say the
>> use of PRIi64 and PRIx64).
>
> we use them in gdb and the sim, although we have gnulib available in the gdb
> subdir.  in general though, i don't see a problem using inttypes.h since glibc
> has had the header since 1997.  wait to see if someone complains.

Thanks Mike.  Given the fact that there has no complaint received so 
far, I have decided to drop the plan of replacing PRIi64 and PRIx64.

Thanks,
Yufeng

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-21 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 17:47 C99 macros Yufeng Zhang
2012-08-15 18:27 ` Mike Frysinger
2012-08-16 13:44   ` Richard Earnshaw
2012-08-21 19:20   ` Yufeng Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).