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

Make Dillo strictly compliant with C90, C++11 and POSIX-2001 #232

Merged
merged 17 commits into from
Aug 7, 2024

Conversation

rodarima
Copy link
Member

@rodarima rodarima commented Jul 28, 2024

This PR changes the default flags in CFLAGS and CXXFLAGS to enable pedantic warnings and making Dillo strictly compliant with C90, C++11 and POSIX-2001.

Several non-portable code had to be modified to either use dlib functions or alternative portable functions.

Additionally, in the CI we enable -Werror so any pedantic warning makes the pipeline fail. It is important to allow other compilers to add pedantic warnings without breaking the build for users.

We can lower the C++11 to C++03 by getting rid of the macros, but it doesn't seem to be worth it for now.

Fixes #217 #218

@rodarima rodarima force-pushed the pedantic-build branch 2 times, most recently from ae0e243 to 0fac879 Compare July 30, 2024 22:36
@rodarima rodarima changed the title Pedantic build Make Dillo strictly compliant with C90, C++11 and POSIX-2001 Aug 6, 2024
@rodarima rodarima force-pushed the pedantic-build branch 3 times, most recently from 0d55a54 to f59f883 Compare August 6, 2024 12:50
@rodarima rodarima marked this pull request as ready for review August 6, 2024 16:04
rodarima added 17 commits August 7, 2024 16:50
Reviewed-by: dogma
It is used by nanosvg library

Reviewed-by: dogma
Reviewed-by: dogma
Reviewed-by: dogma
Instead use inet_addr("127.0.0.1") which is POSIX 2001 and also more
clear.

Reviewed-by: dogma
The strdup function is not available in POSIX-2001, so we use our own
implementation in dlib: dStrdup.

Reviewed-by: dogma
Reviewed-by: dogma
Reviewed-by: dogma
Tested-by: Alex (on OpenBSD)
Also add missing hyphens on previous entries.
While we still require C++11 for the macros, there is no need to add
another dependency for this case.

Reported-by: dogma
@rodarima rodarima merged commit d6e9b4e into master Aug 7, 2024
22 checks passed
@rodarima rodarima deleted the pedantic-build branch August 7, 2024 19:59
@rodarima rodarima added this to the Release 3.2.0 milestone Sep 11, 2024
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.

Defaulted and deleted functions only available with ‘-std=c++11’
1 participant