Conversation
|
These are a lot of changes. Could you please break them down by group and run the tests (at the very least on a recent version of Linux)? There’s a good chance we’ll need to do “mop-up” later fixing things on other platforms, but I’d like to review your changes quickly/efficiently and is sensible batches. The less changes, the more efficiently I can review, then merge them. |
aa50e8a to
8bdf746
Compare
|
Fixed the test for now. Please notify me if there is any problem with this fix. |
There was a problem hiding this comment.
I can only guess why @jmmv wrote it this way, but in K&R C (which predates C++), the () form vs the (void) form can be problematic: https://stackoverflow.com/a/7412301 . I honestly think it's best to be explicit -- it gets programmers into a habit of being explicit, which (given ATF) is important as it can introduce bugs in C.
There was a problem hiding this comment.
Remove redundant qualifiers
I personally believe removing namespace qualifiers like this can prove itself more problematic in the long run, much like star imports in python. It makes it difficult to understand where code lives and can result in accidental namespace collisions.
Using better to be explicit and keep the namespace qualifiers.
ngie-eign
left a comment
There was a problem hiding this comment.
Remove redundant static definition
Again, I can only guess @jmmv 's original intentions, but using static in C code at least can result in more optimal code with -O0 and can avoid namespace collisions and function/variable shadowing.
It's better to leave static in IMHO to be explicit and to avoid these kinds of issues, for the reasoning I provided in my last comment.
There was a problem hiding this comment.
Replace <cstring> with <string>
NAK: std::strcmp (which is used in this source file) is exposed via cstring, not string: https://en.cppreference.com/w/cpp/string/byte/strcmp .
ngie-eign
left a comment
There was a problem hiding this comment.
Use std::move()
NAK:
This code seems like it would be less performant now with -O0 since it's passing by value instead of by reference. Also, depending on how it's called it could result in more data copies on input.
I think the former form is better: it's more explicit and less "by side-effect" than the new form.
|
@ngie-eign I tried to build on macOS 15, but I get this error while running Is this a bug? |
Did you run |
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
This avoids unintentional implicit conversions.
Const-qualification of parameters only has an effect in function definitions.
Repeating the return type from the declaration should be avoided.
This helps avoiding duplicating the type name.
Static definition in anonymous namspace is redundant
Sorry my bad. I didn't install lua which was the issue. Build success on macOS 15. |
|
I'm trying to test on FreeBSD, but pkgconf and lua54 are installed. |
NULLwithnullptrvoidin function declaration/definitionconstthrow()andauto_ptrstatic_cast<>for type conversion