Feature #5157

[PATCH] add -Wunused-variable to CFLAGS

Added by Eric Wong almost 4 years ago. Updated almost 4 years ago.

[ruby-core:38798]
Status:Closed
Priority:Normal
Assignee:Motohiro KOSAKI

Description

Unused variables are ugly.

As an often-careless C extension maintainer, I end up with a lot of unused
variables, so this compiler flag will propagate to extensions I maintain.

The core of Ruby is remarkably free of unused variables despite the
current lack of -Wunused-variable, however I've also attached a trivial
patch to the openssl extension that removes a few unused variables.

0001-configure.in-add-Wunused-variable-to-CFLAGS.patch Magnifier (790 Bytes) Eric Wong, 08/05/2011 06:39 AM

0002-ext-openssl-ossl_-asn1-pkey-.c-remove-unused-variabl.patch Magnifier (1.37 KB) Eric Wong, 08/05/2011 06:39 AM

Associated revisions

Revision 32883
Added by Motohiro KOSAKI almost 4 years ago

  • configure.in: add -Wunused-variable to default CFLAGS. Patch by Eric Wong. [Feature #5157]

Revision 32883
Added by Motohiro KOSAKI almost 4 years ago

  • configure.in: add -Wunused-variable to default CFLAGS. Patch by Eric Wong. [Feature #5157]

Revision 32884
Added by Motohiro KOSAKI almost 4 years ago

  • ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables. Patch by Eric Wong. [Feature #5157]
  • ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
  • ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.

Revision 32884
Added by Motohiro KOSAKI almost 4 years ago

  • ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables. Patch by Eric Wong. [Feature #5157]
  • ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
  • ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.

History

#1 Updated by Motohiro KOSAKI almost 4 years ago

Eric, I think you contributed a lot of patches and you've proved you have enough development and communication skill. So, I'd like to suggest you get a commit right and commit it by yourself.
I'll talk about it with matz and shugo.

#2 Updated by Eric Wong almost 4 years ago

Motohiro KOSAKI kosaki.motohiro@gmail.com wrote:

Eric, I think you contributed a lot of patches and you've proved you
have enough development and communication skill. So, I'd like to
suggest you get a commit right and commit it by yourself.
I'll talk about it with matz and shugo.

Thanks, but it's not my personal belief/style to accept commit rights.
I don't like the idea of shared commit, at all, actually (I prefer the
BDFL model) and I have trouble accepting responsibility :)

--
Eric Wong

#3 Updated by Motohiro KOSAKI almost 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Motohiro KOSAKI

I've assigned it to me then.

#4 Updated by Motohiro KOSAKI almost 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r32883.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • configure.in: add -Wunused-variable to default CFLAGS. Patch by Eric Wong. [Feature #5157]

Also available in: Atom PDF