Comments (3)
It's a tricky situation...
Ultimately, I'm running a project with few users.
If something doesn't quite work right, or outright fails, a user might raise an issue.
If NeoMutt crashes, or an assertion fails, the user is more likely to abandon NeoMutt altogether.
This makes me lean towards defensive programming.
Yes, realloc()
and friends are a mess, but there are some things we could still do...
-
Perhaps we could flag functions with
__attribute__((nonnull))
(as a stepping stone)
I think Coverity can leverage this sort of thing. -
There may still be a few custom list implementations that should use
TAILQ
-
There are LOTS of arrays that would be safer using
ARRAY
(gahr's baby).
Reduce the amount of memory handling to a few "safe" places.
[Aside] - If you want to see a real mess, look at the file-opening code.
from neomutt.
It's a tricky situation...
Ultimately, I'm running a project with few users. If something doesn't quite work right, or outright fails, a user might raise an issue. If NeoMutt crashes, or an assertion fails, the user is more likely to abandon NeoMutt altogether.
This makes me lean towards defensive programming.
Hmmm, I understand.
Yes,
realloc()
and friends are a mess, but there are some things we could still do...
Well, as long as it works, since it's supposedly dead code, I guess we can keep it dead around; I don't mind too much.
* Perhaps we could flag functions with `__attribute__((nonnull))` (as a stepping stone) I think Coverity can leverage this sort of thing.
I'm poking the LLVM people to improve their _Nullable qualifier, which I think is better than [[gnu::nonnull]]. However, it's still not in a usable state. Let's see if we can use that in a few years from now.
* There may still be a few custom list implementations that should use `TAILQ` * There are LOTS of arrays that would be safer using `ARRAY` (gahr's baby). Reduce the amount of memory handling to a few "safe" places.
[Aside] - If you want to see a real mess, look at the file-opening code.
:-)
Thanks!
from neomutt.
this is exactly the type of thing assert() is for, and static analyzers can make good use of it. attribute((nonnull)) is a specialized variation on that which is also visible outside the function.
just don't use it on unsanitized user-/system-provided data.
from neomutt.
Related Issues (20)
- lua-source cannot work in batch mode HOT 8
- Unexpected delay on folder load after scanning messages HOT 5
- Messages deleted outside of Mutt remain in local index, despite having been removed
- Toggle `pager_index_lines` HOT 3
- System tray HOT 7
- Timezone broken in index-format-hook display HOT 3
- `<entire-thread>` with `set nm_query_type = threads` does not preserve selected message
- Behavior with unparsable values of the "Expires" header HOT 4
- Current stable of BerkeleyDB apparently not supported "ouf-of-the-box" HOT 6
- `<tag-thread>` + `<save-message>` skips a thread instead of going to the next one HOT 13
- `test_url_parse` fails without `--pcre2` option to `./configure` HOT 7
- mail list retrive slow HOT 5
- bug fix in release 2022-04-15 breaks transparency/terminal background highlighting. HOT 4
- Hex colours in vim highlighted as comments HOT 1
- `=Y`, `~Y` should match individual keywords, not the space-separated list of keywords HOT 9
- Forwarding mail from the pager -> selecting aliased recipient from adressbook -> pager disappears (or empty pager) HOT 1
- Multiple problems HOT 1
- INBOX-first is broken for children of INBOX
- oauth token is too big HOT 4
- core dump when try to forward jpg attachment HOT 22
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 neomutt.