Skip to content
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

[Improve] ./build.sh:CXXFLAGS_ANALYSIS to remove -Wno-*, include -Wpedantic -Werror in addition to -Wall -Wextra #27

Open
SwuduSusuwu opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@SwuduSusuwu
Copy link
Owner

Rationale: most of what `-Wall -Wextra -Wpedantic warn about are actual issues or, if solved, will assist with ports to new languages (the possible codeflows which pass are a strict subset of those which do not pass, and a strict subset is less effort to port to new languages, thus this assists with issues #3 + #18 + #19 + #20)

Background: 64ca540 introduced -Wall -Wextra (which won't ./build.sh with -Werror without lots of -Wno-* rules.)
Since this, lots of commits which progress towards the above issues have improved this (but still can't ./build.sh with -Werror without -Wno.)

@SwuduSusuwu SwuduSusuwu added bug Something isn't working good first issue Good for newcomers labels Nov 23, 2024
SwuduSusuwu added a commit that referenced this issue Nov 24, 2024
	... , no functional changes* (expect all output equal to output from last commit, which is `HEAD~1`).
	[*The fix for `produceAssistantCns` changes `assistantCns.neuronsPerLayer` from `26666` to `maxWidthOfMessages`, but `assistantCns` is for future use.]

?`build.sh`:
  `CXXFLAGS_ANALYSIS`: -`-Wno-unused`, +`-Wno-unused-function`, +`-Wppedantic`. Is for issue #27 (more close to `-Werror` support).
  Is followup to: 64ca540 (?build.sh:+CXX_FLAGS_ANALYSIS="-Wall ...)

?`cxx/main.hxx`:
	?`susuwuUnitTestsClassResultListBit`: `:%s/Sys/ResultList/`; comment fix.
	Is followup to: 2e01c08 (+`cxx/ClassResultList.cxx`: +`classResultListTests` ... +`susuwuUnitTestsClassResultListTestsBit`), which introduced the comment (plus `susuwuUnitTestsClassResultListBit`).

?`cxx/ClassResultList.hxx`:
	?`listProduceSignature()`: mismatched '{' (in comment) fix.
	Is followup to: commit 30521ed (... ?listProduceSignature() ...), which mismatched that.

?`cxx/ClassSys.hxx`:
	"warning: #includes are not sorted properly [llvm-include-order]" fix.
	Is followup to d50262f (+`classSysGetOwnPath()`, +`classSysFopenOwnPath()`), which triggered the diagnostic.

?`cxx/AssistantCns.hxx`:
	"warning: #includes are not sorted properly [llvm-include-order]" fix.
	Is followup to d3dd3e3 (?cxx/ClassSys.hxx:templateMatchAll Print funcName), which triggered the diagnostic.

?`cxx/AssistantCns.cxx`:
	Remove `execvex` from `#include ClassCns.hxx` comment. Is followup to 69e3329 (+cxx/ClassSys.{h,c}xx +`execves` +`execvex`), which moved `execvex` into `ClassSys.hxx`.
	?`assistantCnsProcessXhtml`: "string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation]" fix.
	?`produceAssistantCns`: "warning: 26666 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]" fix. Is followup to f5a7a37 (...`cxx/VirusAnalysis.cxx`: ... `warning: 26666 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]` fix), which should have fixed `produceAssistantCns` too.

?`cxx/VirusAnalysis.cxx`:
	?`produceAbortListSignatures`: more readable; don't use raw `std::get<0>(tuple)`.

?`posts/VirusAnalysis.md`: Include all this.
SwuduSusuwu added a commit that referenced this issue Nov 24, 2024
?`cxx/VirusAnalysis.cxx`:
	?`virusAnalysisHook`; `s/[] (/auto lambdaScan = [] (/` ("warning: expression result unused [-Wunused-value]" fix for issue #27.). Deduplicate lambdas.

Is followup to: commit b8023f3 (... ?`build.sh`: `CXXFLAGS_ANALYSIS`: -`-Wno-unused`), d5444b1 (?cxx/VirusAnalysis.*xx:+virusAnalysisHook(enum))

?`posts/VirusAnalysis.md`: Include all this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant