« first day (3512 days earlier)      last day (1419 days later) » 

12:00 AM
If someone has edit privileges, please rollback this post: stackoverflow.com/q/62048958/2452869 to revision 2.
the author decided to use editing to remove their question.
 
12:26 AM
Nothing makes me laugh more than silly segfaults XD
 
1:02 AM
Only C++ where the same syntax has entirely different effects when compiled twice; Context
 
1:18 AM
Copy elision has got to be one of the more annoying things to syntactically get used to with RVO and constructor initialization
It's still a useful feature though
 
 
8 hours later…
9:49 AM
Dug a hole for concrete footing a week ago. Came back a week later to the farm to find a frog calling the hole home.
 
Lol
 
Froggy :D
 
 
2 hours later…
nwp
12:03 PM
Frenchies are not allowed to say "Froggy :D".
 
 
1 hour later…
1:24 PM
I remember my early days of C++ when dividing integers and realized that integer division was a thing XD
 
nwp
1:35 PM
I kinda wanna make or explore a programming language with some more operator syntax sugar.
Overloading operator % for floats should totally be a thing you can do.
 
if you want emoji operators Scala is always there for you
 
nwp
Also a f b should be valid syntax sugar for f(a, b).
 
yeah, that's what Scala does and it's annoying as fuck when initially learning
couldn't find documentation for the life of me
because I didn't even know where to look
 
nwp
Precedence is probably annoying. I don't know how one would specify that.
constexpr bool operator <(operator +, operator *) { return true; }
And then you need to specify left to right or right to left in case they are equal.
It's probably a good idea to leave some of them unspecified to keep nonsensical operator combinations ill-formed.
Have I mentioned that I don't want to work but have to sit here for another 2 hours?
 
2:39 PM
@nwp careful there, we might go on strike
 
nwp
Imagine if you could be racist against French. I'd probably get flagged.
I want to make what I believe to be an IncrediBuild clone called "morbid". Which stands for "MORe BuIlDs" or something.
 
What have the French done to you?
 
nwp
Nothing that I know of. And I didn't mean to be mean. It's just that if French were blacks my froggy comment would have been racist. Maybe.
 
What do you mean frenchies aren't black x)
 
Sorry, wrong group.
 
2:52 PM
I have briefly used CDT like 5 years ago
 
nwp
I do for embedded. But only because it's what is compatible with embedded debuggers. I'm very unhappy with it because the code backend is incorrectly set up and I don't know how to fix it.
 
I can't understand why there are project templates.
I wonder if I should use a folder with C files instead of a poject instead...
 
nwp
Because setting up a project is a huge pain and project templates make it slightly less painful.
A folder with C files is not sufficient. You also need to tell Eclipse what to do with the C files. Which is what a project file is for and a C application project template helps with that.
 
@nwp Suppose I am not using eclipse, then a folder would be sufficient right?
 
nwp
No. You still need to tell the IDE what to do.
 
2:56 PM
No, suppose I compile and link the files using cmd
 
nwp
Some IDEs have become smart enough that they guess that you probably want an application for the platform you run on using cmake and gcc. But those are guesses. Once you want to make or use a library you need a project file.
You can tell IDEs to run a command which can be a script that builds your thing, but then you lose all the advantages of an IDE and are left with a text editor that needs 100MB+ RAM.
Normally IDEs use LSP to ask clangd what the code means so that it can offer you semantic highlighting, code completion, jump to definition and so on. If you don't set up a proper project then that stuff doesn't work.
While it is very painful and time-consuming to set up a project it's ultimately worth it.
 
What is the difference?
 
nwp
Run the program in a container, like a virtual machine like Docker (I think) or run it locally on the same machine as the IDE is running.
 
Oh okay.
 
nwp
If you pick the container it will ask how to connect to it and how to control it. If you pick local machine it should know what to do without further instructions.
 
 
1 hour later…
4:09 PM
Hi all. :]


Got a question about CMake...

I'm currently building an application that uses `find_package` to create a link to a library that needs to be installed on my local machine.

But how would I go about bundling the external package into my executable?
 
 
3 hours later…
user7659542
7:28 PM
So...
 
user7659542
I have a segmentation fault in a project containing 250k+ lines of code. Application is multithreaded, no gdb, no unit or integration tests available.
 
user7659542
Segfault happens randomly, no pattern.
 
user7659542
Any suggestions to track down the bug?
 
user13268771
hi guysss,
 
user13268771
any idea how to put a comma separated integer textile into a 2d array in c++ (without using any of the c++11 functions)??
 
user13268771
7:33 PM
thanks
 
9:40 PM
@traducerad valgrind?
 
user7659542
@EtiennedeMartel no valgrind, or tracing on that system
 
So, no debugging tools of any kind?
 
user7659542
Nope
 
user7659542
cross compile the source code, upload it to the target and "enjoy"
 
Run a static analysis tool on the source?
 
user7659542
9:42 PM
hmm maybe
 
user7659542
what tool would you suggest for the static code analysis?
 
If there's a segfault, there's a bug somewhere.
 
user7659542
no sh*t sherlock :p
 
nwp
10:08 PM
Race conditions and data races are notoriously difficult to debug even with tools. And at that size you're pretty screwed. Your best chance in my opinion is getting someone experienced making a concept and enforcing that concept.
 
user7659542
@nwp what do you meany by a concept?
 
nwp
You need a way to organize your data to ensure you can't write a data race. One way to do that is to forbid access to mutable global variables, forbid passing pointers and references to threads and require data exchange to happen via the threads' message queues.
Another way if you can't have a message queue is to have data copied to threads. Another is to label every piece of data that the threads get access to and specify the data race avoidance strategy in the name or a wrapper type.
What is appropriate depends on how the code is structured until now.
 
user7659542
@nwp Horribly.
 
10:57 PM
hi all
I have an object that contains a few numbers and a c-style string on the heap
I want to hash that as efficiently as possible
Currently, I allocate a string, serialize the object into a string of the format "n1.n2.n3.c_string" and hash that using std::hash<std::string>
I can use boost::hash_combine, but that still requires a string allocation, since there seems to be no overload of boost::hash_combine for std::string_view
Any ideas? Or am I misreading the docs for hash_combine and there is a way to combine std::hash results with it, too?
 

« first day (3512 days earlier)      last day (1419 days later) »