Skip to content

Commit

Permalink
devel/libcbor: fix strict prototype warnings with clang 15
Browse files Browse the repository at this point in the history
During an exp-run for llvm 15 (see bug 265425), it turned out that
security/libfido2 failed to build with clang 15:

  In file included from /wrkdirs/usr/ports/security/libfido2/work/libfido2-1.12.0/src/aes256.c:8:
  In file included from /wrkdirs/usr/ports/security/libfido2/work/libfido2-1.12.0/src/fido.h:42:
  In file included from /usr/local/include/cbor.h:14:
  /usr/local/include/cbor/arrays.h:100:51: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
  CBOR_EXPORT cbor_item_t* cbor_new_indefinite_array();
                                                    ^
                                                     void
  In file included from /wrkdirs/usr/ports/security/libfido2/work/libfido2-1.12.0/src/aes256.c:8:
  In file included from /wrkdirs/usr/ports/security/libfido2/work/libfido2-1.12.0/src/fido.h:42:
  In file included from /usr/local/include/cbor.h:15:
  /usr/local/include/cbor/bytestrings.h:107:54: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
  CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring();
                                                       ^
                                                        void

And many more of these -Werror warnings, all due to declarations in
libcbor's headers. These are triggered because functions taking no
parameters should be declared with "(void)", not "()".

I would like to propose to fix the problem on the libcbor side, by
editing the declarations and definitions of such functions in the port
Makefile. This cleans up all warnings in devel/libcbor, and also fixes
security/libfido2 as a consequence.

PR:		268417
Approved by:	maintainer timeout (2 weeks)
MFH:		2022Q4
  • Loading branch information
DimitryAndric committed Dec 25, 2022
1 parent 0f1ce09 commit ee691f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions devel/libcbor/Makefile
Expand Up @@ -24,5 +24,7 @@ USE_GITHUB= yes

post-patch:
@${REINPLACE_CMD} -e 's|-flto||; /subdirs(examples)/d' ${WRKSRC}/CMakeLists.txt
@${REINPLACE_CMD} -e 's|();|(void);|' ${WRKSRC}/src/cbor/*.h ${WRKSRC}/src/cbor/internal/*.h
@${REINPLACE_CMD} -e 's|() {|(void) {|' ${WRKSRC}/src/cbor/*.c ${WRKSRC}/src/cbor/internal/*.c

.include <bsd.port.mk>

0 comments on commit ee691f8

Please sign in to comment.