[libvirt] [PATCH 00/19] Use '#pragma once' in headers

Eric Blake eblake at redhat.com
Fri Jun 14 20:51:13 UTC 2019


On 6/14/19 11:18 AM, Jonathon Jongsma wrote:

>>
>> Note that we do have syntax-check for this, it had to be loosened in:
>> commit ac41ffb8fa1235c226377397842c6c240a677d87
>> Author:     Cole Robinson <crobinso at redhat.com>
>> AuthorDate: 2019-04-03 17:45:02 -0400
>> Commit:     Cole Robinson <crobinso at redhat.com>
>> CommitDate: 2019-04-04 18:42:09 -0400
>>
>>     build-aux: header-ifdef: Handle #pragma once
>>
>>     If we see it, skip all remaining header guard checks
>>
>>     Acked-by: Eric Blake <eblake at redhat.com>
>>     Signed-off-by: Cole Robinson <crobinso at redhat.com>
>>
>> But currently it accepts both variants.
>>
>> Jano
> 
> Out of curiosity, do we want to use #pragma once in the public headers
> as well, or only the internal ones?
> 

Only internal. Our public headers (in theory) should be usable from any
non-gcc/clang C99 compiler.  #pragma once is a non-portable compiler
extension that happens to be portable to the only two compilers we admit
for building libvirt itself, but that does not imply that we are going
to force other projects using the public headers to do the same.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190614/9d854d52/attachment-0001.sig>


More information about the libvir-list mailing list