Skip to content

Commit 4138597

Browse files
committed
Fix async examples build for asn_orig.c
Add settings.h include before the compile guard in asn_orig.c so WOLFSSL_IGNORE_FILE_WARN is available when compiled separately. Add -Wno-pedantic for asn_orig.c in async examples Makefile to suppress empty translation unit warning.
1 parent b0517a2 commit 4138597

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

examples/async/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ $(OBJDIR)/wolfcrypt/src/fipsv2.o: CFLAGS += -Wno-pedantic
6767
$(OBJDIR)/wolfcrypt/src/selftest.o: CFLAGS += -Wno-pedantic
6868
$(OBJDIR)/wolfcrypt/src/wolfcrypt_first.o: CFLAGS += -Wno-pedantic
6969
$(OBJDIR)/wolfcrypt/src/wolfcrypt_last.o: CFLAGS += -Wno-pedantic
70+
$(OBJDIR)/wolfcrypt/src/asn_orig.o: CFLAGS += -Wno-pedantic
7071

7172
clean:
7273
$(RM) -r $(OBJDIR) $(TARGETS)

wolfcrypt/src/asn_orig.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@
2222
/*
2323
* Original (non-template) ASN.1 implementations.
2424
* This file is included from asn.c when building without WOLFSSL_ASN_TEMPLATE.
25-
* It does not need to be compiled as a separate file.
25+
* It must not be compiled as a separate translation unit.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include <config.h>
30+
#endif
31+
#include <wolfssl/wolfcrypt/settings.h>
32+
2833
#ifndef WOLFSSL_ASN_ORIG_INCLUDED
2934
#ifndef WOLFSSL_IGNORE_FILE_WARN
3035
#warning asn_orig.c does not need to be compiled separately from asn.c

0 commit comments

Comments
 (0)