Repository: SCons/scons (language: python)

Issue:
Replace all instances of `int main()` with `int main(void)`
This PR replaces all instances of `int main()` in `.py` files with `int main(void)`.

The consensus here is that `int main(void)` is also valid in C++: https://stackoverflow.com/q/44859450/119527

Fixes #3095.

## Contributor Checklist:

* [ ] I have created a new test or updated the unit tests to cover the new/changed functionality.
* [x] I have updated `master/src/CHANGES.txt` directory (and read the `README.txt` in that directory)
* [ ] I have updated the appropriate documentation
Configure.CheckLib() error with -Wstrict-prototypes
This is a continuation of #3095. As noted in [this comment](https://github.com/SCons/scons/pull/3096/files#r1257532304), there was one more instance that was missed in PR #3096:

https://github.com/SCons/scons/blob/810ca6c8895b01cbd636d83079f6a848dc36adf6/SCons/Conftest.py#L677-L684


Discussion / hints:
Can you address the items in the contributor checklist?  Minimally src/CHANGES.txt
Also looks like your change broke this test? test/D/Scanner.py  Can you take a look? See the travis-ci results above.
What's the newest version of gcc which might break with this change? Maybe none?
I'm guessing you'd need a K&R C compiler and not ansi..?
Looks like the the test compiler dmd isn't happy with this change - and is pretty explicit about it.
Can you revert the change to the D test case? Likely it's not legal D source code?
@bdbaddog Thanks for the feedback. I updated `src/CHANGES.txt`.

I didn't add any tests explicitly covering this case because there were already tests that did. If we really wanted to, we could add a case testing with `-Wstrict-prototypes`, but being GCC-specific, that seemed to be more complicated than it's worth.

I've done a fair amount of research, and can't answer your question about GCC versions. AFAICT, using `void` to indicate an empty parameter list has always been valid with ANSI C compilers.

The `test/D/Scanner.py` change was unintended, and I have undone it.
Thanks for checking. Yes ANSI C has always allowed such.
However K&R C compilers would probably have an issue.
Additionally I'm not sure if K&R only C compilers are in use among our user base which would be using the configure checks.  

I
I'm going to merge. The change is in CHANGES.txt and if we start to get reports from the field that ancient compilers are having an issue then we can address it then. Thanks!


Fix patch:
diff --git a/CHANGES.txt b/CHANGES.txt
index ee08ab7019..7cd71dda41 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -97,6 +97,10 @@ RELEASE  VERSION/DATE TO BE FILLED IN LATER
     - Cleaned up dblite module (checker warnings, etc.).
     - Some cleanup in the FortranCommon tool.
 
+  From Jonathon Reinhart:
+    - Fix another instance of `int main()` in CheckLib() causing failures
+      when using -Wstrict-prototypes.
+
 
 RELEASE 4.5.2 -  Sun, 21 Mar 2023 14:08:29 -0700
 


Test patch:
diff --git a/SCons/Conftest.py b/SCons/Conftest.py
index 3541bce0ad..6af5e78893 100644
--- a/SCons/Conftest.py
+++ b/SCons/Conftest.py
@@ -676,8 +676,7 @@ def CheckLib(context, libs, func_name = None, header = None,
 
     # if no function to test, leave main() blank
     text = text + """
-int
-main() {
+int main(void) {
   %s
 return 0;
 }