Page MenuHomeFreeBSD

libcbor: ignore unknown #pragmas for GCC
AbandonedPublic

Authored by emaste on Tue, May 7, 2:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 14, 2:56 PM
Unknown Object (File)
Thu, May 9, 5:47 PM
Unknown Object (File)
Wed, May 8, 5:40 AM
Unknown Object (File)
Wed, May 8, 5:39 AM
Unknown Object (File)
Wed, May 8, 2:06 AM
Unknown Object (File)
Tue, May 7, 7:22 PM
Subscribers
None

Details

Reviewers
jhb
dim
Summary
The GCC build failed with "error: ignoring '#pragma clang diagnostic'"
building libcbor.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste requested review of this revision.Tue, May 7, 2:14 PM
emaste created this revision.

I used this patch locally since we have a builtin for this warning in bsd.sys.mk:

commit e4c30eacb0a0c8116102e215527ac63e0f0e3b2d (nvmf_gcc)
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Mon May 6 13:06:21 2024 -0700

    libcbor: Ignore errors for unknown #pragmas
    
    libcbor embeds clang-specific #pragmas that GCC then warns about.

diff --git a/lib/libcbor/Makefile b/lib/libcbor/Makefile
index 5ae2c34a5963..c9d86c0b95ad 100644
--- a/lib/libcbor/Makefile
+++ b/lib/libcbor/Makefile
@@ -30,6 +30,7 @@ SRCS+=        cbor/internal/unicode.c
 CFLAGS+= -I${DIST}/src -I${.CURDIR}
 
 WARNS?=        2
+IGNORE_PRAGMA=
 MAN=
 
 .include <bsd.lib.mk>
In D45114#1028902, @jhb wrote:

I used this patch locally since we have a builtin for this warning in bsd.sys.mk:

Do you want to just push that one instead? Reviewed by: emaste

In D45114#1028902, @jhb wrote:

I used this patch locally since we have a builtin for this warning in bsd.sys.mk:

Do you want to just push that one instead? Reviewed by: emaste

libcbor is contrib'd code, right? Otherwise I'd just put an #ifdef __clang__ around it :)

In D45114#1028908, @dim wrote:

libcbor is contrib'd code, right? Otherwise I'd just put an #ifdef __clang__ around it :)

It is indeed. I don't have a problem with a trivial change in the contrib src, but a Makefile hack seems easiest.

Yeah, if it wasn't contrib'd code I'd hack it directly as well. On IRC yesterday there was some discussion about just removing it as unnecessary, and upstream should probably clean this up, but I think a Makefile hack is cleanest for us. I can push my version with Ed's stamp.

@jhb will push his version instead