Skip to content

Make GCC 7.1.1 happy#11675

Closed
choleraehyq wants to merge 1 commit into
grpc:masterfrom
choleraehyq:master
Closed

Make GCC 7.1.1 happy#11675
choleraehyq wants to merge 1 commit into
grpc:masterfrom
choleraehyq:master

Conversation

@choleraehyq
Copy link
Copy Markdown

Fix #11376 and several other warnings:

src/core/lib/security/credentials/jwt/jwt_verifier.c: In function ‘pkey_from_jwk’:
src/core/lib/security/credentials/jwt/jwt_verifier.c:483:10: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
       rsa->n =
          ^~
make: *** [Makefile:2496: /home/cholerae/cxcode/grpc/objs/opt/src/core/lib/security/credentials/jwt/jwt_verifier.o] Error 1
[cholerae@x240s grpc]$ vim src/core/lib/security/credentials/jwt/jwt_verifier.c
[cholerae@x240s grpc]$ make
[MAKE]    Generating cache.mk
[C]       Compiling src/core/lib/security/credentials/jwt/jwt_verifier.c
src/core/lib/security/credentials/jwt/jwt_verifier.c: In function ‘pkey_from_jwk’:
src/core/lib/security/credentials/jwt/jwt_verifier.c:484:25: error: ‘r’ undeclared (first use in this function)
       if (!RSA_set0_key(r, bignum_from_base64(exec_ctx, validate_string_field(key_prop, "n")), NULL, NULL)) {
                         ^
src/core/lib/security/credentials/jwt/jwt_verifier.c:484:25: note: each undeclared identifier is reported only once for each function it appears in
src/core/lib/security/credentials/jwt/jwt_verifier.c:493:10: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
   if (rsa->e == NULL || rsa->n == NULL) {
          ^~

See openssl/openssl#1491

src/core/tsi/ssl_transport_security.c: In function ‘tsi_create_ssl_client_handshaker_factory’:
src/core/tsi/ssl_transport_security.c:1285:3: error: ‘TLSv1_2_method’ is deprecated [-Werror=deprecated-declarations]
   ssl_context = SSL_CTX_new(TLSv1_2_method());
   ^~~~~~~~~~~
In file included from /usr/include/openssl/opensslconf.h:42:0,
                 from /usr/include/openssl/ct.h:13,
                 from /usr/include/openssl/ssl.h:61,
                 from src/core/tsi/ssl_transport_security.c:45:
/usr/include/openssl/ssl.h:1629:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
 ^
src/core/tsi/ssl_transport_security.c: In function ‘tsi_create_ssl_server_handshaker_factory_ex’:
src/core/tsi/ssl_transport_security.c:1393:7: error: ‘TLSv1_2_method’ is deprecated [-Werror=deprecated-declarations]
       impl->ssl_contexts[i] = SSL_CTX_new(TLSv1_2_method());
       ^~~~
In file included from /usr/include/openssl/opensslconf.h:42:0,
                 from /usr/include/openssl/ct.h:13,
                 from /usr/include/openssl/ssl.h:61,
                 from src/core/tsi/ssl_transport_security.c:45:
/usr/include/openssl/ssl.h:1629:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
 ^
At top level:
src/core/tsi/ssl_transport_security.c:118:22: error: ‘openssl_thread_id_cb’ defined but not used [-Werror=unused-function]
 static unsigned long openssl_thread_id_cb(void) {
                      ^~~~~~~~~~~~~~~~~~~~
src/core/tsi/ssl_transport_security.c:110:13: error: ‘openssl_locking_cb’ defined but not used [-Werror=unused-function]
 static void openssl_locking_cb(int mode, int type, const char *file, int line) {
             ^~~~~~~~~~~~~~~~~~

Don't know why.

src/core/ext/transport/cronet/transport/cronet_transport.c: In function ‘create_grpc_frame’:
src/core/ext/transport/cronet/transport/cronet_transport.c:652:10: error: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Werror=conversion]
   *p++ = (flags & GRPC_WRITE_INTERNAL_COMPRESS) ? (uint8_t)(1) : (uint8_t)(0);
          ^

I'm using fedora 26 and GCC 7.1.1.

Signed-off-by: Cholerae Hu huyingqian@pingcap.com

Signed-off-by: Cholerae Hu <huyingqian@pingcap.com>
@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

12 similar comments
@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

3 similar comments
@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link
Copy Markdown

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@jtattermusch
Copy link
Copy Markdown
Contributor

due to our transition from .c files to .cc files, this PR would need updating. As that seems as quite a bit of work, I'll close this. Original PR can still be used as a reference when fixing.

(when fixing build for newer compilers, a build for given compiler should also be added to the portability suite to prevent breaking again)

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants