You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "eddelbuettel (via GitHub)" <gi...@apache.org> on 2024/01/12 20:36:13 UTC

[I] [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp` [arrow-nanoarrow]

eddelbuettel opened a new issue, #362:
URL: https://github.com/apache/arrow-nanoarrow/issues/362

   After syncing with the headers as in `dist/` now (and from a very gentle and gingerly use of a little JSON as now supported) I started to see this in a little test repo:
   
   ```
   nanoarrow/nanoarrow_testing.hpp: In member function ‘ArrowErrorCode nanoarrow::testing::TestingJSONWriter::WriteColumn(std::ostream&, const ArrowSchema*, const ArrowArrayView*)’:
   nanoarrow/nanoarrow_testing.hpp:470:42: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
     470 |                                 std::move(dictionary_output.str()));
         |                                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~                               
   nanoarrow/nanoarrow_testing.hpp:470:42: note: remove ‘std::move’ call
   ```
   
   and indeed, just removing the `std::move()`  appears to work in the 'well `valgrind` does not complain' sense.
   
   So I can send you a PR that does the equivalent of this if you want me to.
   
   I am on Ubuntu 23.10 with `g++-13` version 13.2.0 in case it matters.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp` [arrow-nanoarrow]

Posted by "eddelbuettel (via GitHub)" <gi...@apache.org>.
eddelbuettel commented on issue #362:
URL: https://github.com/apache/arrow-nanoarrow/issues/362#issuecomment-1889966373

   Will do -- and would have done immediately but wasn't sure if the `std::move()` there was on purpose (hence my quick attempt at `valgrind` and I _think_ that is in the code path as a printed some JSON).
   
   If I adjust `src/nanoarrow/nanoarrow_testing.hpp` then `dist/nanoarrow_testing.hpp` will flow automagically because of how the repo is organized, correct?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp` [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot closed issue #362: [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp`
URL: https://github.com/apache/arrow-nanoarrow/issues/362


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp` [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #362:
URL: https://github.com/apache/arrow-nanoarrow/issues/362#issuecomment-1890589102

   > If I adjust src/nanoarrow/nanoarrow_testing.hpp then dist/nanoarrow_testing.hpp will flow automagically because of how the repo is organized, correct?
   
   Yes, or you can generate it using `cmake -DNANOARROW_BUNDLE=ON` followed by `cmake --install .` to get it immediately.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [r] Compiler nag on 'pessimizing move' from `nanoarrow_testing.hpp` [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #362:
URL: https://github.com/apache/arrow-nanoarrow/issues/362#issuecomment-1889963400

   Thanks for reporting! A PR would be great!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org