apache / arrow-nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
https://arrow.apache.org/nanoarrow
Apache License 2.0
169 stars 35 forks source link

[r] Harmless (?) but noisy nag from compiler #354

Closed eddelbuettel closed 9 months ago

eddelbuettel commented 9 months ago

I see

nanoarrow/nanoarrow_testing.hpp: In member function ‘ArrowErrorCode nanoarrow::testing::TestingJSONWriter::WriteType(std::ostream&, const ArrowSchemaView*)’:
nanoarrow/nanoarrow_testing.hpp:351:15: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
  351 |     ArrowType type;                         
      | 

and in

  ArrowErrorCode WriteType(std::ostream& out, const ArrowSchemaView* field) {
    ArrowType type;
    if (field->extension_name.data != nullptr) {
      type = field->storage_type;
    } else {
      type = field->type;
    }

    out << "{";

    switch (field->type) {
    // [...]

type is never used. Did you mean to switch on type, not field->type ? If not the six lines at the top can probably go.

paleolimbot commented 9 months ago

Thanks for reporting! Closed in #342.

eddelbuettel commented 9 months ago

Appreciate it -- but I don't see it changed in my checkout or in the repo here: https://github.com/apache/arrow-nanoarrow/blob/6523f511799537ac1dc3b210d8e804caff02edd9/dist/nanoarrow_testing.hpp#L350-L357

paleolimbot commented 9 months ago

The generated files get generated nightly!

eddelbuettel commented 9 months ago

Gotcha.