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

Compiler warnings for generated code #271

Closed
michael-p opened this issue Apr 14, 2022 · 1 comment · Fixed by #281
Closed

Compiler warnings for generated code #271

michael-p opened this issue Apr 14, 2022 · 1 comment · Fixed by #281
Labels
good first issue Good for newcomers

Comments

@michael-p
Copy link

Dear all,

This isn't really a bug, more like a small annoyance, but given the superb quality of this crate I figured I'd report it anyway... :)

On recent nightly (rustc 1.62.0-nightly (34a6c9f26 2022-04-13)), the generated code produces a compiler warning:

warning: unused doc comment
  --> crates/blimp_mpc/path_follow/icasadi_path_follow/src/lib.rs:33:1
   |
33 |   /// C interface (Function API exactly as provided by CasADi)
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 | / extern "C" {
35 | |     fn cost_function_path_follow(
36 | |         arg: *const *const c_double,
37 | |         casadi_results: *mut *mut c_double) -> c_int;
...  |
49 | |     ) -> c_int;
50 | | } // END of extern C
   | |_- rustdoc does not generate documentation for extern block
   |
   = note: `#[warn(unused_doc_comments)]` on by default
   = help: use `//` for a plain comment

The corresponding generated code block is:

/// C interface (Function API exactly as provided by CasADi)
extern "C" {
    fn cost_function_path_follow(
        arg: *const *const c_double,
        casadi_results: *mut *mut c_double) -> c_int;
    fn grad_cost_function_path_follow(
        arg: *const *const c_double,
        casadi_results: *mut *mut c_double)
        -> c_int;
    fn mapping_f1_function_path_follow(
        arg: *const *const c_double,
        casadi_results: *mut *mut c_double,
    ) -> c_int;
    fn mapping_f2_function_path_follow(
        arg: *const *const c_double,
        casadi_results: *mut *mut c_double,
    ) -> c_int;
} // END of extern C

Thanks,
Michael

@alphaville alphaville added the good first issue Good for newcomers label Apr 21, 2022
@alphaville
Copy link
Owner

Hi Michael. Many thanks for reporting this. We'll fix it in the next release.

@alphaville alphaville mentioned this issue Jun 22, 2022
5 tasks
alphaville added a commit that referenced this issue Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants