Does it benefit analysis tools? Which ones? There are no ambiguities in C and C++ syntax. If an analysis tool is confused by C or C++ syntax, it would be vastly more useful to spend effort on fixing the broken analysis tool than in going through the world's C and C++ sources to make them match whatever the buggy tool wants to see.
> From: [email protected] via RT [mailto:[email protected]] > Sent: Monday, August 04, 2014 9:44 AM > Cc: [email protected] > Subject: [openssl.org #3481] Add space to help compiler/analyzer parse > token > > This came up during testing. The entire issue is not clear, but here's > the issue filed on Github: "Minor typo change in ssl/s3_enc.c", > https://github.com/openssl/openssl/issues/151: > > For c/cpp syntax analysis ambiguities, is it possible to change in > int ssl3_digest_cached_records(SSL *s) > > memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST > *sizeof(EVP_MD_CTX *)); > to > memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST * > sizeof(EVP_MD_CTX *)); > > Adding a space between the "*" and the "sizeof" should be fairly > inert. If it benefits analysis tools, then I think it would be a good > idea. > > $ git diff ssl/s3_enc.c > diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c > index 6c103a0..8ad5d57 100644 > --- a/ssl/s3_enc.c > +++ b/ssl/s3_enc.c > @@ -617,7 +617,7 @@ int ssl3_digest_cached_records(SSL *s) > /* Allocate handshake_dgst array */ > ssl3_free_digest_list(s); > s->s3->handshake_dgst = OPENSSL_malloc(SSL_MAX_DIGEST * > sizeof(EVP_MD_CT > - memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST > *sizeof(EVP_MD_CTX *)); > + memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST * > sizeof(EVP_MD_CTX *)); > hdatalen = BIO_get_mem_data(s->s3->handshake_buffer,&hdata); > if (hdatalen <= 0) > { > ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [email protected]
