GCC format attributes

3 views
Skip to first unread message

Davide Libenzi

unread,
Oct 13, 2015, 3:00:55 PM10/13/15
to aka...@googlegroups.com
I think it will be useful to decorate Akaros stdio functions with format attributes, to help GCC consistency checks.
Like:

int cprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));

Barret Rhoden

unread,
Oct 13, 2015, 3:38:52 PM10/13/15
to aka...@googlegroups.com
On 2015-10-13 at 12:00 "'Davide Libenzi' via Akaros"
In general, this sounds nice, so long as it doesn't break anything
we're doing. We have some non-standard formats, and we use %p all the
time for longs.

Barret

Davide Libenzi

unread,
Oct 13, 2015, 3:56:37 PM10/13/15
to aka...@googlegroups.com
Oh, GCC won't like it than ☺



Barret

--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ron minnich

unread,
Oct 13, 2015, 5:16:38 PM10/13/15
to aka...@googlegroups.com
I would prefer for such things that we confirm that clang supports it too. I'm going through this now with harvey, as we remove ken c special things, we are being careful to ensure we don't add gcc special things.

Is this stuff also usable with clang?

Thanks

ron

Davide Libenzi

unread,
Oct 13, 2015, 5:32:10 PM10/13/15
to aka...@googlegroups.com
One of the objectives of clang is gcc compatibility, so I would expect that to be.
But, if there is a lot of code violating the printf formatting rules, than it is better not to enable those.

Reply all
Reply to author
Forward
0 new messages