Re: Why is ptrdiff_t a volatile?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/10/2018 11:10, Marc Glisse wrote:
On Mon, 1 Oct 2018, Toby Douglass wrote:

Good morning/afternoon/evening, all.

I've been writing some position independent data structure code.

As such, I've been using ptrdiff_t.

I've just noticed, while compiling, that my GCC (6.3.0) has ptrdiff_t as a volatile long int.

I doubt gcc does that. More likely your code has a broken macro somewhere. You don't provide enough information for us to help more...

I thought I'd given enough for the question :-)

But I think you might be right indeed.

I've just had another line of output from GCC when it's unhappy with my code, which is this;

"note: expected ‘lfds720_pal_uint_t * {aka long long unsigned int *}’ but argument is of type ‘ptrdiff_t * {aka long int *}’"

Now before I was being told a ptrdiff_t was a volatile long int.

It looks like if I add volatile to a type, it turns up in the "aka".

I was not expecting this - I thought the aka would be the underlying type, sans qualifiers.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux