[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58617] cell2struct silently truncates char ma
From: |
Kai Torben Ohlhus |
Subject: |
[Octave-bug-tracker] [bug #58617] cell2struct silently truncates char matrices |
Date: |
Mon, 22 Jun 2020 01:16:42 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36 |
Update of bug #58617 (project octave):
Assigned to: None => siko1056
_______________________________________________________
Follow-up Comment #4:
Rik, thank you for going into this. This surprised me indeed, too.
// compile with:
//
// (clan)g++ -std=c++11 -Wall -Wextra -pedantic
#include <iostream>
#include <memory>
#include <vector>
std::unique_ptr<std::vector<int>> global_stuff;
std::vector<int> do_something () {
std::vector<int> retval;
return *global_stuff;
return retval;
}
int main () {
global_stuff = std::unique_ptr<std::vector<int>> (new std::vector<int> ({1,
2, 3}));
std::vector<int> val = do_something ();
for (auto const& v : val) {
std::cout << v << ' ' << std::endl;
}
return 0;
}
Entirely undetected my garbage in both GCC and clang?!
Anyways, I fixed this
https://hg.savannah.gnu.org/hgweb/octave/rev/bc521cd24922
It might take more time to get into the rest, where to fix this
appropriately.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58617>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/