wishlist: support for shorter pointers

Rafał Pietrak embedded@ztk-rp.eu
Wed Jul 5 08:05:18 GMT 2023


Hi,

W dniu 5.07.2023 o 09:29, Martin Uecker pisze:
> Am Mittwoch, dem 05.07.2023 um 07:26 +0200 schrieb Rafał Pietrak:
[-------]
>> And if it's so ... there is no mention of how does it show up for
>> "simple user" of the GCC (instead of the use of that "machinery" by
>> creators of particular GCC port). In other words: how the sources should
>> look like for the compiler to do "the thing"?
>>
> 
> Not sure I understand the question.  You would add a name space
> to an object as a qualifier and then the object would be allocated
> in a special (small) region of memory.  Pointers known to point
> into that special region of memory (which is encoded into the
> type) would then be smaller.  At least, this is my understanding
> of how it could work.

Apparently you do understand my question.

Then again ... apparently you are guessing the answer. Incidentally, 
that would be my guess, too. And while such "syntax" is not really 
desirable (since such attribution at every declaration of every "short 
pointer" variable would significantly obfuscate the sources and a thing 
like "#pragma" at the top of a file would do a better job), better 
something then nothing. Then again, should you happen to fall onto an 
actual documentation of syntax to use this feature with, I'd appreciate 
you sharing it :)

-R


More information about the Gcc mailing list