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

qblist: Retype ptr in qb_list_entry to char* #385

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

jfriesse
Copy link
Member

This allows pointer arithmetics without issuing warning.

Signed-off-by: Jan Friesse jfriesse@redhat.com

This allows pointer arithmetics without issuing warning.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
@jfriesse
Copy link
Member Author

jfriesse commented Feb 25, 2020

@chrissie-c A bit longer comment. I was trying to find out why corosync build was failing only in CI and not when testing on my machines. The reason is, that CI is using non-system libqb. Gcc (and probably other compilers?) have exception for header files in system directories and all warnings are suppressed. Sogcc -I$PATH_TO_QB cpg.c would fail as long as $PATH_TO_QB is not (for example) /usr/include, if it is, it would succeed.This is achievable for other directories by using-isystem flag, but honestly I don't see it as a best way to go.

The patch in kernel which changed (char *) to (void *) - torvalds/linux@c7acec7 - was, AFAICT, not that much about (char *) but about const. We don't have that, so I think retype to (char *) should do the job just fine without any problems.

Another possibility would be to remove Wpointer-arith from all of our projects and have big warning in libqb docs about this behavior (so using system installed libqb is fine, but if it is outside of system directories it will produce warning). IMHO not omptimal solution.

@jfriesse jfriesse requested a review from chrissie-c February 25, 2020 14:01
@chrissie-c chrissie-c merged commit 9249caf into ClusterLabs:master Feb 26, 2020
@chrissie-c
Copy link
Contributor

Thanks for your investigations into this. It's good to know what was going on!

@jfriesse jfriesse deleted the list-char-pointer branch February 26, 2020 09:22
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