Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redundant redeclaration of X509_OBJECT_new and X509_OBJECT_free #1556

Closed
tatsuhiro-t opened this issue Apr 28, 2024 · 2 comments · Fixed by #1560
Closed

redundant redeclaration of X509_OBJECT_new and X509_OBJECT_free #1556

tatsuhiro-t opened this issue Apr 28, 2024 · 2 comments · Fixed by #1560
Assignees

Comments

@tatsuhiro-t
Copy link

Problem:

X509_OBJECT_new and ‘X509_OBJECT_free are declared twice which causes compile error

aws-lc/include/openssl/x509.h

Lines 3282 to 3293 in c25dc2a

// X509_OBJECT_new allocates an |X509_OBJECT| on the heap.
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_new(void);
// X509_OBJECT_free frees an |X509_OBJECT| from the heap.
OPENSSL_EXPORT void X509_OBJECT_free(X509_OBJECT *a);
// X509_OBJECT_new returns a newly-allocated, empty |X509_OBJECT| or NULL on
// error.
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_new(void);
// X509_OBJECT_free releases memory associated with |obj|.
OPENSSL_EXPORT void X509_OBJECT_free(X509_OBJECT *obj);

Relevant details

AWS-LC commit: v1.25.0

System information: for linux, below info can be collected by running uname -srvmp

  • CPU architecture: x86-64
  • CPU name: N/A
  • OS: Ubuntu 22.04

Build log:

In file included from /home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/pem.h:67,
                 from /home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/ssl.h:149,
                 from /home/runner/work/ngtcp2/ngtcp2/ngtcp2-1.5.0-DEV/crypto/boringssl/../../crypto/includes/ngtcp2/ngtcp2_crypto_boringssl.h:30,
                 from /home/runner/work/ngtcp2/ngtcp2/ngtcp2-1.5.0-DEV/crypto/boringssl/boringssl.c:33:
/home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/x509.h:3080:29: error: redundant redeclaration of ‘X509_OBJECT_new’ [-Werror=redundant-decls]
 3080 | OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_new(void);
      |                             ^~~~~~~~~~~~~~~
/home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/x509.h:3073:29: note: previous declaration of ‘X509_OBJECT_new’ with type ‘X509_OBJECT *(void)’ {aka ‘struct x509_object_st *(void)’}
 3073 | OPENSSL_EXPORT X[50](https://github.com/ngtcp2/ngtcp2/actions/runs/8867065534/job/24345229180#step:26:51)9_OBJECT *X509_OBJECT_new(void);
      |                             ^~~~~~~~~~~~~~~
/home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/x509.h:3083:21: error: redundant redeclaration of ‘X509_OBJECT_free’ [-Werror=redundant-decls]
 3083 | OPENSSL_EXPORT void X509_OBJECT_free(X509_OBJECT *obj);
      |                     ^~~~~~~~~~~~~~~~
/home/runner/work/ngtcp2/ngtcp2/aws-lc/include/openssl/x509.h:3076:21: note: previous declaration of ‘X509_OBJECT_free’ with type ‘void(X509_OBJECT *)’ {aka ‘void(struct x509_object_st *)’}
 3076 | OPENSSL_EXPORT void X509_OBJECT_free(X509_OBJECT *a);
      |                     ^~~~~~~~~~~~~~~~
@andrewhop
Copy link
Contributor

Thanks for reporting this, what compiler are you using? I'm trying to figure out why our CI didn't catch this issue.

andrewhop added a commit that referenced this issue Apr 29, 2024
…1560)

### Issues:
Resolves #1556

### Description of changes: 
Remove the duplicate X509_OBJECT_new and X509_OBJECT_free declarations
from #1506.

### Testing:
I'm still looking into why our CI didn't catch this and what we can add
that would catch this in the future.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
andrewhop added a commit that referenced this issue Apr 29, 2024
…s on (#1561)

### Issues:

Addresses #1556

### Description of changes: 
Fix a few other cases of duplicate definitions and turn this on so the
CI can catch this in the future.

### Call-outs:
We own this s2n-bignum header file.

### Testing:
We have GCC CI for x86/ARM.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
@tatsuhiro-t
Copy link
Author

It is gcc-12. I did not enable -Werror=redundant-decls explicitly but it was somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants