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

Static analysis warnings #659

Closed
Hackerpilot opened this Issue May 13, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@Hackerpilot

Hackerpilot commented May 13, 2014

I've been adding some more checks to D-Scanner and decided to test them out on Vibe.d. There were some false positives due to the way that the tool handles string mixins (It doesn't handle string mixins). I looked through the results manually and came up with this list of places in the code that I believe should be examined:

./http/form.d(223:8)[warn]: Variable form is never used
./http/common.d(147:25)[warn]: opCmp, toHash, opEquals, and toString should be declared const
./http/common.d(231:25)[warn]: opCmp, toHash, opEquals, and toString should be declared const
./http/dist.d(28:7)[warn]: Variable baddr is never used
./http/websockets.d(74:8)[warn]: Variable pProtocol is never used
./http/websockets.d(131:8)[warn]: Variable pProtocol is never used
./http/server.d(115:85)[warn]: Parameter request_handler is never used
./web/rest.d(148:9)[warn]: Variable path is never used
./data/json.d(1753:48)[warn]: Parameter line is never used
./data/bson.d(352:10)[warn]: Variable key is never used
./data/bson.d(459:9)[warn]: opCmp, toHash, opEquals, and toString should be declared const
./data/bson.d(1162:38)[warn]: opCmp, toHash, opEquals, and toString should be declared const
./db/mongo/connection.d(282:7)[warn]: Variable resid is never used
./internal/meta/funcattr.d(647:10)[warn]: Variable name is never used
./utils/memory.d(56:8)[warn]: Variable ret is never used
./utils/memory.d(167:10)[warn]: Variable csz is never used
./inet/path.d(186:10)[warn]: Variable idx is never used
./templ/diet.d(719:10)[warn]: Variable textstring is never used
./templ/diet.d(1314:51)[warn]: Parameter indent is never used
./templ/diet.d(1319:53)[warn]: Parameter indent is never used
./core/log.d(642:21)[warn]: Variable ss_fileLogger is never used
./core/core.d(122:8)[warn]: Variable thisthr is never used
./core/core.d(1250:7)[warn]: Variable thisthr is never used
./core/drivers/libev.d(303:8)[warn]: Variable self is never used
./core/drivers/win32.d(238:9)[warn]: Variable aif is never used
./core/drivers/win32.d(314:8)[warn]: Variable addr is never used
./core/drivers/win32.d(485:8)[warn]: Variable newcnt is never used
./core/drivers/win32.d(585:8)[warn]: Variable nstr is never used
./core/drivers/win32.d(1538:58)[warn]: Variable s_timers is never used
./core/drivers/libevent2.d(229:30)[warn]: Variable dnsReq is never used
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 14, 2014

Member

Thanks for posting these! I've corrected most of the places now - fortunately with no bugs spotted, except one possible performance bug in memory.d where more memory was touched than necessary.

The only thing that I didn't correct so far was the "opCmp, toHash, opEquals, and toString should be declared const" warning for class members, since these methods are actually declared as mutable in object_.d.

Member

s-ludwig commented May 14, 2014

Thanks for posting these! I've corrected most of the places now - fortunately with no bugs spotted, except one possible performance bug in memory.d where more memory was touched than necessary.

The only thing that I didn't correct so far was the "opCmp, toHash, opEquals, and toString should be declared const" warning for class members, since these methods are actually declared as mutable in object_.d.

@s-ludwig s-ludwig closed this May 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment