Comments (12)
For the first case I agree, there should be some error handling for fwrite in get in main.c
As for sparkey_hash_close, I am not sure what a suitable way to handle that error would be. Closing a read-only file should always succeed and be a safe operation.
If you have any convincing arguments or a good patch, I'll be happy to reevaluate my position on it.
from sparkey.
Is this an improvement for the first of your issues at least? 1c499c0
from sparkey.
Yes, of course. - How do you think about to rename the added function so that its functionality can be easily distinguished from the well-known macro "assert"?
I hope that return value ignorance can be changed further. Would you like to add an annotation like "warn_unused_result" to any function of your API?
from sparkey.
Sure, the assert could be renamed, but it's not part of the public api so does it really matter?
I guess warn_unused_result would make sense for almost everything in the API.
Feel free to make pull requests if there's something you want to fix, I'll try to review and merge as soon as possible.
from sparkey.
I suggest a small disambiguation. Would you like to add a cast to void for the error message there (and similar places)?
from sparkey.
I am not sure why we need that. Are you running some sort of extra strict compiler or compilation flags or analysis tool?
If your endgoal is to reduce false positives or build failures, that would make perfect sense, but then it's probably best if the developer who is using such a compiler or tool makes the suitable change to fix it, otherwise it would mostly be fumbling in the dark. Your change sounds good overall, but I want to be able to reproduce the problem you're having before writing any fix.
from sparkey.
I would like to make static source code analysis easier and a bit more complete.
Are you interested in aspect-oriented software development?
from sparkey.
I am still not quite understanding your issue.
Do you want to use sparkey, but your static source code analysis finds errors so you can't do that? If so, can you tell me how you're trying to build it so I can reproduce the errors or fix them? Alternatively you can fork and fix them yourselves and submit a pull request.
Are you building a static source code analyser and are using sparkey as sample input? If so, I think it would be easiest if you forked and fixed the easy errors you find and create separate issues for each non-trivial error, including instructions for how to get that error.
from sparkey.
I have found update candidates during my own little code review. Now I try to clarify if fixes should be applied manually or if improvements can also be achieved by specific tools automatically.
Error detection (and corresponding exception handling) is a well-known cross-cutting concern. How do you think about to encapsulate it as a reusable aspect in your software?
from sparkey.
Are any further changes going to come out of this issue? I don't see checking for errors on close
, nor casting things to void, actually happening. Tempted to close this.
@elfring Do you have any other specific changes for or issues with sparkey?
from sparkey.
It seems that the Sparkey software was already strong with regarding of return values. There might be a few places "left over" for further improvements. ;-)
from sparkey.
Closing the issue, as there is nothing really specific that should be done.
from sparkey.
Related Issues (20)
- Improve hash algorithm description in README HOT 10
- libsparkey.so.0: cannot open shared object file HOT 3
- make failure HOT 2
- What about a python binding? HOT 6
- sparkey_logiter_reset doesn't reset HOT 6
- sparkey_hash_write returns successfully when given an invalid hash size HOT 4
- REPL HOT 2
- Feature request: sparkey_logiter_hashskip HOT 4
- Is there a go client anywhere? HOT 1
- Take rpm-sparkey upstream HOT 4
- Do I have to use the C bindings of Snappy? HOT 2
- Non-exact seeks? HOT 5
- Problem creating hash indices larger than available RAM HOT 7
- does sparkey support open a store for writing subsequent times HOT 1
- Comparison to NuDB? HOT 6
- Tag a Release HOT 2
- Build breaks with newer versions of GCC
- Converting multiple log-files into a hash-file in bulk HOT 4
- File descriptor leak when hash/log files are corrupt or not matching HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparkey.