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
source cleanup: remove all custom typedef structs #5338
Conversation
bagder
commented
May 4, 2020
- Stick to a single unified way to use structs
- Make checksrc complain on 'typedef struct {'
- Allow them in tests, public headers and examples
On 5 May 2020, at 10:50, Daniel Stenberg ***@***.***> wrote:
Yeah, I was more going for the one way here rather than actually making a stand against typedefs.
+1
|
209482f
to
436130e
Compare
436130e
to
10bd507
Compare
Buckle up. I'm going to land this asap. Just pushed a rebase and if things still are fine this will land. |
c4f3ed4
to
6184194
Compare
- Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions.
6184194
to
402b19d
Compare
Someone emailed me and asked me about the motivation for this work and here's basically my extended motivation. Using But I'm arguing for this change primarily for consistency. Our code has a mix of typedef'ed structs and real structs and there's nothing to hint about when we use either approach and I've come to be annoyed by not knowing. It has basically depended on the mood of the particular author which style that is used in which function. I want the curl source code to look and feel like it was written by a single author with a single mindset on how code should look like. To make the code clean, easy to read and easy to understand - which then implies consistent. That leads to less bugs and in particular less security problems - a better product. Therefor, I want us to use structs in the code using one consistent way. |
On 14 May 2020, at 15:11, Daniel Stenberg ***@***.***> wrote:
... use structs in the code using one consistent way.
FWIW, this gets a big +1 from me.
|
Most autobuilds fail, because the ".checksrc" files are not found. The autobuilds perform an "out-of-tree" build. |