Skip to content

Fix strict function prototype warnings#467

Merged
daanx merged 1 commit into
microsoft:devfrom
tiran:strict_prototypes
Oct 19, 2021
Merged

Fix strict function prototype warnings#467
daanx merged 1 commit into
microsoft:devfrom
tiran:strict_prototypes

Conversation

@tiran

@tiran tiran commented Oct 19, 2021

Copy link
Copy Markdown
Contributor

Fix warning warning: function declaration isn’t a prototype when
building mimalloc with -Wstrict-prototypes flag. In C argumentless
functions should be declared as func(void).

Reproducer:

$ cmake ../.. -DCMAKE_C_FLAGS="-Wstrict-prototypes"
$ make VERBOSE=1

Co-authored-by: Sam Gross colesbury@gmail.com
Co-authored-by: Neil Schemenauer nas@arctrix.com
Signed-off-by: Christian Heimes christian@python.org

Fix warning ``warning: function declaration isn’t a prototype`` when
building mimalloc with ``-Wstrict-prototypes`` flag. In C argumentless
functions should be declared as ``func(void)``.

Reproducer:
```shell
$ cmake ../.. -DCMAKE_C_FLAGS="-Wstrict-prototypes"
$ make VERBOSE=1
```

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Neil Schemenauer <nas@arctrix.com>
Signed-off-by: Christian Heimes <christian@python.org>
@ghost

ghost commented Oct 19, 2021

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@tiran

tiran commented Oct 19, 2021

Copy link
Copy Markdown
Contributor Author

We are testing mimalloc for CPython. Python core is compiled with -Wstrict-prototypes. This changeset silences a bunch of compiler warnings that we are getting from mimalloc.

@daanx daanx changed the base branch from master to dev October 19, 2021 16:30
@daanx daanx merged commit 1917fbd into microsoft:dev Oct 19, 2021
@daanx

daanx commented Oct 19, 2021

Copy link
Copy Markdown
Collaborator

Thanks so much! I didn't know about the strict-prototypes flag -- I'll add it to the cmake also as that is much better.

I am excited to see the work on evaluating mimalloc for CPython -- let's make it great for that environment as well :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants