-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix -Wextra warnings in real time code #3333
Conversation
…ameters, signed/unsigned issues and missing initialization.
Looks good to me. When you cast something like the baudrate to (unsigned), I keep thinking to myself that this should always have been unsigned in the first place. "unset" could just be 0. I just mention this here to see if anyone else wants to comment on this. |
I pulled this one into draft because it touches componentized files in a way that we may want to discuss. Many (over 40) .comp files do not use the If we introduce The only disadvantage is that you then need to add the option if you intend to use the period parameter. That said, changing halcompile is an API change. It may involve user-written code. Either way, they will see a warning (unused parameter period) with this patch or they see an error (period not declared) with the halcompile option way. The question is then: do we walk the "expose users to warning or error" path? Alternative is to set the option to default yes and add a |
With a version LinuxCNC 3 maybe not so far from now, an API change seems possible. I would however opt for the default "option period yes" so no incompatible API change results. |
…function (default enable). Adapt component files to use period option.
This PR should fix the real-time part in the -Wextra warnings cleanup.
It turned out that the CFLAGS were not propagated to the RT compile causing the code to be compiled without -Wextra. A whole list of issues turned up after propagating the -Wextra option. The fixed warnings include:
Al of these are fixed in this PR when compiling uspace. There may still be problems in the code when compiling with RTAI or Xenomai because some drivers are not compiled in uspace. These issues will have to wait until a local build-environment can be made.