tech-userlevel archive

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

Re: Adding missing __printflike attributions



On Sun, 04 Mar 2012, Julio Merino wrote:
Portability is one of the reasons why we use __printflike instead of
__attribute__((__format__(whatever))). Readability is another reason.

You can define __printflike differently for different compilers just as
easily as you can define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF differently
for different compilers, so ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF·does not
seem to have any advantage.

Except that the code lives in external/bsd/atf/ and is shipped in other systems that do not have __printflike.

__printflike is a NetBSD-ism, right? If so, why do you think NetBSD is more important than any other system and thus __printflike has to be used?

I did not intend to imply that __printflike "has to be used" or that NetBSD is more important than other systems; I simply intended to imply that "portability" was not a valid reason for avoiding the use of __printflike.

You already have

        #define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) ...

in the atf sources.  What I meant in my earlier message
was that you could change it to

        #define __printflike(a, b) ...

with no loss of portability to non-NetBSD systems, and with an increase in readability.

Given the the issue with identifiers starting with underscores, which you mentioned in another message, I may have been wrong about the portability issue. In my defence, you did not mention underscores until after I had written my message.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index