Page MenuHomeFreeBSD

Clean up dead code and fix a warning: unused-but-set-variable spotted by gcc4.9.
ClosedPublic

Authored by araujo on Dec 28 2015, 8:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 19 2024, 9:33 AM
Unknown Object (File)
Oct 12 2024, 8:19 PM
Unknown Object (File)
Oct 10 2024, 8:00 AM
Unknown Object (File)
Oct 2 2024, 4:45 AM
Unknown Object (File)
Oct 2 2024, 2:42 AM
Unknown Object (File)
Oct 1 2024, 4:04 PM
Unknown Object (File)
Sep 30 2024, 9:08 AM
Unknown Object (File)
Sep 27 2024, 2:12 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

araujo retitled this revision from to Clean up dead code and fix a warning: unused-but-set-variable..
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo retitled this revision from Clean up dead code and fix a warning: unused-but-set-variable. to Clean up dead code and fix a warning: unused-but-set-variable spotted by gcc4.9..Dec 28 2015, 8:03 AM
araujo added reviewers: rodrigc, bapt, ae.

I have not any strong objection about this. But I prefer the commented code should be left here. I added it to be compatible with current behavior, but in future we can change this.

In D4720#100209, @ae wrote:

I have not any strong objection about this. But I prefer the commented code should be left here. I added it to be compatible with current behavior, but in future we can change this.

I think removing the code's ok, but maybe a better XXX comment should be put in so someone could fill in the blanks later (I ran into some code in lib/libc/rpc recently like this with unimplemented paths)?

In D4720#100240, @ngie wrote:
In D4720#100209, @ae wrote:

I have not any strong objection about this. But I prefer the commented code should be left here. I added it to be compatible with current behavior, but in future we can change this.

I think removing the code's ok, but maybe a better XXX comment should be put in so someone could fill in the blanks later (I ran into some code in lib/libc/rpc recently like this with unimplemented paths)?

I agree with @ngie, @ae could you give me any input about how we could add some comments there? Maybe we can remove that commented code, and insert at the comments the revision that add that code and an explanation about what that should do.

what do you think @ae?

sys/net/if_gre.c
718 ↗(On Diff #11737)

XXX: The current implementation uses the key only for outgoing packets. But we can check the key value here, or even in the encapcheck function.

araujo edited edge metadata.

Address @ae comments, and for now we don't remove the code.
We will still have the gcc-4.9 warning, but for those that are cleaning it up, they will know by
the comment, it is something not implemented yet.

sys/net/if_gre.c
718 ↗(On Diff #11787)

Please add a newline before the XXX per style(9).

Sidenote: I'm fine (personally) with removing the variables or commenting out the code under another #ifdef (e.g. KEY_SUPPORT_NOTYET), as long as the comments are there documenting the item that needs to be implemented (so two birds could be killed with one stone)

sys/net/if_gre.c
719 ↗(On Diff #11788)

Please add a space between the XXX: and The.

In D4720#100407, @ngie wrote:

Sidenote: I'm fine (personally) with removing the variables or commenting out the code under another #ifdef (e.g. KEY_SUPPORT_NOTYET), as long as the comments are there documenting the item that needs to be implemented (so two birds could be killed with one stone)

I would prefer a #ifdef too, the meaning of this patch is to lower the compiler warnings. I will address @ngie suggestion together with the 'space'.

Wrap using #ifdef notyet those variables and statements not yet implemented.
Suggested by @ngie.

@ae what do you think about it?

Cosmetic fix, one tab missed.

ngie added a reviewer: ngie.

LGTM. @ae should sign off too.

This revision is now accepted and ready to land.Dec 30 2015, 8:56 AM
bapt edited edge metadata.
ae edited edge metadata.
This revision was automatically updated to reflect the committed changes.