Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "clang"
-
I've never used Windows in my day-to-day life. No kidding.
When I got my father's first computer, I used an old distribution called BBC Linux. I didn't have any computer knowledge, it was my first contact with a computer, so I went to a friend's house and asked for a CD to install on my computer. I don't know if this friend ended up making a "gotcha" and thought I'd give up, but I just read the manuals and fell in love. That was year 2000.
Then I used Conectiva Linux, then I went to Red Hat 9, then Slackware, then in 2007 I started using Solaris. And I stayed on Solaris (Solaris 10, Solaris Nevada and OpenSolaris) until 2011.
In 2011 I bought a Mac. I stayed at Apple until 2020, when I couldn't stand Apple forcing me to buy new computers (I still don't understand how a 2011 iMac, i5 (4 Hyper Thread cores) with 16GB of RAM, 1TB SSD only runs up to High Sierra).
Then I bought a Dell. It came with Windows 10, the first thing I did was install WSL2. I could not stand it, the system is bad, sorry. I installed OpenSuse and have been using it for two years.
It's just that every day someone tells me "how can you use this"? "There is no alternative to Windows, do you want to be different?"
I know that my story was the reverse of the "mainstream", so I'm going to talk about my vision of Windows, that in my brain it is actually the "alternative".
- Having a file explorer without "tabs" in 2022 is unthinkable for me.
- I love terminal. And the Windows terminal is very limited. "ps ... | awk ... | xargs ..." is a must for me. "find ./ -name '...' -exec ..."... these things on Windows are totally "different" and have the "powershell way" while all other operating systems keep the same form. And cygwin is not an option. As Wine for serious work is also not.
- Dragging a file into the terminal, and having it write its path, is so natural, that when Windows didn't do it, I was dismayed.
- I've always used StarOffice, OpenOffice and now LibreOffice. All the people in my story received my documents and reports as a PDF and no one complained. Until a coworker saw me editing in LibreOffice and said "oh I want it in word format". As long as he didn't know, everything was fine, right?
- Windows is paid. And is there advertising? I don't understand. And I refuse. If you want to display advertising, then excuse me. I have no problem paying, I'm not an opensource shiite. It's just that paying and not working bothers me much more than an opensource that I can fix or expect a fix knowing the good will of the people involved.
- Hyper-V is a joke. QEMU/KVM is better, and Bhyve on FreeBSD which is a very young project, is already a million times better than Hyper-V.
- Developing in C/C++ for Windows is only possible in two ways: Either you've always lived in Windows and your brain is conditioned, or you compile with MSYS2 (CLang or GCC).
- There is no significant evolution of the windows desktop since 95.
- Multiple workspace support with multiple monitors, not ready. It's another joke.
- REGEDIT does not need any comment.
- The system loses performance over time. I still don't know how Windows achieves this.
- I've seen people complain about desktop fragmentation on Unix and Linux. Many DEs end up leaving applications with different themes (like running a Qt application in Gnome and GTK in KDE), but to be quite honest, the lack of Windows standard bothered me much more. Even Microsoft's own software is completely different: Control Panel, Calculator, Paint and Office, To-Do, and Settings, have horrible style differences and look-and-feel fragmentation.
- Dark mode has not been implemented. It's another joke. Many applications are white while everything else is dark. Sorry, even on Linux which is a mess, this has been resolved. And well resolved.
- NTFS? Serious?
- C:, D:.. It doesn't convince me since DOS.
- Bloatware.
- News "biased" in the search bar is a lack of respect for those who use the computer to work.
And that. For me, Windows is the alternative operating system. I can't take Windows seriously, for me it's an experimental one like Haiku or ReactOS. It's good to play.
About market share, it doesn't convince me to use it. But convinces me to sell. I've always developed applications to run on Windows. And when I need it, I turn on a VM to compile the project. But in everyday life? Impractical.15 -
Here is another rather big example of how C++ is WAY slower than assembler (picture)
Sure - std::copy is convenient
but asm is just way faster.
This code should be compatible with EVERY x86_64 CPU.
I even do duffs device without having the loop:
the loop happens in the rep opcode which allows for prefetching (meaning that it doesnt destroy the prefetch queue and can even allow for preprocessing).
BTW: for those who commented on my comment porn last time: I made sure to satisfy your cravings ;-)
To those who can't make sense of my command line:
C++ 1m24s
ASM 19s
To those who tell me to call clang with -o<something>:
1) clang removes the call to copy on o3 or o2
2) the result isnt better in o1 (well... one second but that might be due to so many other things, and even if... one second isn't that much)25 -
Both GCC and Clang can switch off the braindead type-based aliasing rules through the "-fno-strict-aliasing" compiler option so that everything can alias everything.
On the other hand, C offers the "restrict" qualifier for pointers where you promise that nothing will alias this memory area, not even same type pointers.
What happens if you use "restrict", but compile with "-fno-strict-aliasing"? Will the "restrict" be obeyed or disregarded?
Answer in the comments.8 -
OK so... project I've been working on! It's a virtual processor that runs in the browser coded in JavaScript. OK so I know, I know, you must be thinking, "this is crazy!" "Why would she do this?!?!" and I understand that.
The idea of Tangible is is to see if I can get any tangible performance over JavaScript. I've posted a poorly drawn diagram below showing how tangible works.
The goal for tangible is to not use html, javascript, or CSS. Instead, you would use, say for instance, c++ and write your web page in that, then you compile it using my clang plugins and out pops your bytecode for Tangible. No more CSS, no more html, and no more javascript. Instead everything from a textbox to a video on your web page is an object, each object can be placed into a container, each container follows specific flag rules like: centerHorizontal or centerVertical.
Added to all of this you get the optimization of the llvm optimizer.18 -
New team, same discussions...
* Why should we use cmake? It is way better to add visual studio project files to the repository and allow everyone to mess around in the compiler setting dialogs. Nobody needs cmake if not targeting multiple platforms!
* clang-format? What kind of black magic is this? It is way better to manually try to stick with each source file's existing formatting - regardless of how messed up it is - and manually check that from time to time!
* Why should we use the latest visual studio 2019 compiler, if 2017 and 2015 do just fine? This way we can save license fees!
/irony off
Just to mention a few highlights...13 -
one of my guys decided to start learning c++ for the fun and fuck of it. We do not use c++ for shit (we web developers in this bitch) and he asked me if in the event of him getting completely fucking stuck he could come to me for guidance, I said sure. I do use c++ for personal game projects....it is mostly very bad C until I need c++, it is horrible seriously, I ain't no expert.
He decides to go with the LLVM. Creates a simple hello world app. Runs clang++ main.cpp -o main.
**QUICK PAUSE**
Done, the CLI returns the prompt back to him. He comes and asks me wtf is going on. I check on my machine(Linux based) and do the exact same thing. Executable comes out.
I check back on his windows machine, try typing the same shit. Nada. It does not throw errors or warnings, and the syntax is fucking fine, can't really fuck up c-outing hello fucking world. FUCKING NADA
I couldn't sit down to troubleshoot since it was still working hours, but this shit is haunting me and I am going ballsack crazy knowing that I won't be able to jump at it until tomorrow.
This just makes me dislike c++, i usually never have issues like that, but then again, I use the microsoft compiler (bitch at me all you want, most game developer tutorials etc use that shit, so does the Cherno, its all i know OK????)
I am going to go crazy sdjkfhasdkjlfghlajkhrfvluidefjbhfksjadhjksdsdsjksdjkl11 -
compile with gcc, ./a.out: "Segmentation fault (core dumped)"
compile with clang, ./a.out: runs and fails.
compile with cc, ./a.out: Alternated between "Error: Too many arguments" and "Segmentation fault"...
ffs I'm done for the week I guess.
The problem is not that it fails, the problem is that it alternates because of time of compilation, power consumption, random blody oracles or the phase of the moon in a leap year on a Friday the 13th. God.Please.Send.~Nudes~. Help.rant clang afraid to use other compilers compiler argp linking what is that cc gcc subliminal segmentation faults stumble12 -
Slipping a cheeky '#define true (rand() > 5)' at the top of your code because you're edgy and like to mix things up2
-
I ranted about it already.
```c++
if (vec.size() > 0) { // or whatever
cout << vec.size();
// ....
}
```
Its output was zero. And before you ask, it was a single thread program.
Aince it was for my thesis and I was in a hurry I didn't care too much for it.
Yet I think that it was a bug in clang. I removed that piece of code, compiled, rewritten it a bit differently and worked as expected. Never looked back.9 -
Everyone here who complains about slow Android studio obviously never tried to compile LLVM/Clang from source.3
-
Today in Windows Clang misadventures from one past wtf
I have 0 fucking clue what is happening, so I am starting to think that this is a windows 11 only bug.
If I (say for example) compile all of my headers into a .dll and then link them to my executable program, an executable will be generated.
If I use the dll to be linked into my executable, but DON'T use any of the code inside, then no executable is generated.
I need to at least use something from within the headers that I create into the main program for it to build and actually throw out an executable.
I could argue that doing this would be the proper way to setup a project in some scenarios, managing your headers and what not.
The only bad part is that it essentially removes the ability for newcomers to just install clang and hello the fucking world into existence.
Mind you, using the Mingw installation is possible still. I-just-don't-fuckig-understand-why-the-fucking-official-build WORKS
THIS is why people are trying to jump into other languages. My dude's shit is solved, but this fucking infuriates me. ANd go on, try googling "clang not building executable" and see how this shit is nowhere to be fucking found sdfksakjdfa3 -
what the fuck I can't edit the rant after 5 minutes I am fucking posting a new rant which have that last rant ...Why they update the fucking x code in every fucking 15 days . Well some libraries are deprecated oh cool I can use my shit as an object. And why third party libraries don't provide some good documentation of their sdk's . What the fuck is that and I will personally kill auto layout by entering in the mac myself. What is the use of that fucking debugging tool if I know don't the crap of my code that in which class I have done something terribly wrong what the fuck . Oh cool I am having that clang error and I don't know how to wipe my ass. And please fucking don't tell me to use xib code in xcode for my project if there will be 600 screens I will still fucking use storyboard for that. I don't fuck with xib files do you hear me. And fucking stackoverflow ..what the fuck is wrong if I forget an single comma during posting a question ..what the fuck..and you know what the real feeling is when I post a issue on stackoverflow and I got nothing from them expect some minus points...and then the holy fucking coder inside me tells me to solve that fucking problem and I feel like having dope bitch. FUCCKKKK..4
-
"Reflective" programming...
In almost every other language:
1. obj.GetType().GetProperties()
or
for k, v in pairs(obj) do something end
or
fieldnames(typeof(obj))
or
Object.entries(obj)
2. Enjoy.
In C++: 💀
1. Use the extern keyword to trick compilers into believing some fake objects of your chosen type actually exist.
2. Use the famous C++ type loophole or structured binding to extract fields from your fake objects.
3. Figure out a way to suppress those annoying compiler warnings that were generated because of your how much of a bad practice your code is.
4. Extract type and field names from strings generated by compiler magic (__PRETTY_FUNCTION__, __FUNCSIG__) or from the extremely new feature std::source_location (people hate you because their Windows XP compilers can't handle your code)
5. Realize your code still does not work for classes that have private or protected fields.
6. Decide it's time to become a language lawyer and make OOPers angry by breaking encapsulation and stealing private fields from their classes using explicit template instantiation
7. Realize your code will never work outside of MSVC, GCC or CLANG and will always be reliant on undefined behaviors.
8. Live forever in doubt and fear that new changes to the compiler magic you abused will one day break your code.
9. SUFFER IN HELL as you start getting 5000 lines worth of template errors after switching to a new compiler.13 -
Clang? I don't fucking understand... what are you trying to tell me?
Couldn't you just compile like GCC? Fuck you T_T7 -
CUDA is a fucking bitch when it comes to configure projects
Creating my first CUDA project it yelled at me it doesn't support my current gcc version, ended up with me yelling back "OY SHUTUP" and slapping some flag for it to use clang instead — basically what it advised but I didn't listen first. Fine now.
Working on this project on another fresh environment, and now it doesn't detect anything and dumbly tries to reload my CMake project with the LATEST installed gcc when I already told it to use version 8 TWICE. First by setting up a toolchain with compilers pointing to this specific version and second by passing the -DMAKE_C_COMPILER pointing to it again. Still this stubborn piece of shit tries with latest everytime.
The most applauded solution was to use update-alternatives to make gcc point to the version I want CUDA to use. Thank you genius, but what if I don't want to use a deprecated gcc version with normal Cxx projects ?
And cherry on the top of this bullshit, I'm fixing this dumb configuration issue (can't stress enough how much I hate this shit) to be able to fix an EVEN MORE annoying issue with CUDA being a bitch AGAIN and not letting me use std functions where I'm allowed to
Fuck CUDA. Fuck CMake. Fuck C. Fuck everything3 -
What the fucking shit is up with clang invoking gcc???
If I wanted gcc I would have called gcc, now do your damn work and stop doing stupid shit
The only thing I want to do is compile some c to a static lib. I've already wasted the entire day on this fucking bullshit. fuckckaf3 -
Just spent 3 hours trying to understand why my compiler isn`t even trying to compile my code until i found out it was a known clang bug.
-
>compiling Linux 3DS' zImage overnight
>start compiler at 4PM
>11:54PM -- compiling clang: <file>: conpiler: *internal compiler error*: segmentation fault
okay, well, maybe if we continue make from there it'll fix itself? Might've run out of RAM...
>make
>5 seconds later, segfault again
FUCK1 -
When you jokingly suggest overriding MAX_INT32 to be something 10x larger to accommodate larger trades, then come back to numerous messages about how "the number wouldn't fit into a signed int anymore" and "you can't just do that wtf", you really start to question who you're talking to 😂😂
-
mfw when clang decides my NSDictionary changed its type somehow to the same type as my block pointer thingy and now I can’t assign to it3
-
So I did some testing with WebAssembly to see how it works in the most recent version and without Emscripten. I installed CMake and Visual Studio Community 2015 and compiled Binaryen, LLVM and Clang for a few hours (had to do it multiple times because I used the wrong version and forgot a compile flag), ended up with over 10 GB less free space on my laptop.
All that to compile a < 1kb C file to < 1kb WASM code.
At least it works for now and can natively run in (some) browsers.2 -
Hi guys,
I'm going to make a template project for Cpp. And one of my questions is how to use Travis ci to test things with clang 6, on every platform. I was thinking about using a custom docker, but I didn't find a project using this. Is there a problem with it?5 -
Anyone uses rtags for C++ code browsing?
It’s pretty accurate since it’s based on clang but it’s a bit slow sometimes.
It appears to be using a weird amount of memory though.1 -
Guess who found a Clang bug old of at least one year? :D
I just need to recode the most complex class of my code, thanks Clang, I love you <3.
https://devrant.io/rants/825972/... -
well... I really dont know how to explain this error
in the directory where I have my testing.cpp file, I type "clang testing.cpp -o testing"
my result is just supposed to be hello world and I am getting this.
note: clang is my c++ compiler since for some divine reason I can't install GCC on termux.
I checked the github and no one gives this complaint. I honestly can't read that error code, I just want it to go away
I hate coding on android, it's always a sorry case
I could have been a farmer or a teacher or a bus driver or an alien but I chose coding. I am really tired
I took a very long screenshot6 -
Any recommendations for a C/C++ IDE for Linux.
I really like PyCharm and IntelliJ for python and java but can't afford to splash out on CLion for C++.
Eclipse is completely out, I have too much of that at work and it is a total pain.
My current solution would be vim and clang but I'd like something more IDE like.10 -
Fuck VS! C# sucks! F# sucks!
I found no way to debug C # and F # without VS(At least the official did not give a plan)! And I can only use macOS now.
After downloading VS for mac, I found that it installed mono automatically! And there is not even a button to open the folder!
Why do you have to wrap a class outside the main function? And their pointers are not flexible at all! Also, unlike C, Go, and Rust, the compiled files are binary files. WTF does DotNet give me? debug directories and .dll files!
I originally planned to learn DotNet core for the convenience of using Azure.
But I found that, through Python, JavaScript, Ruby, C(LLVM-Clang), Go, C ++, Rust, Haskell, Azure can also be used, which gives me more sufficient reasons to give up C #, F #!14 -
When using python, almost every other linter/formatter shoves down pep8 down my throat.
I used autopep8, which has NO CONFIG FOR USING TABS. FFS. The only solution I could find is disabling indent reformatting. How is this a solution at all?
Then I found black. Black is a piece of shit. Let's move on.
Now, I use yapf+pylint. This is basically clang-fomat for python. I love it, it does exactly what I expect it to do.2 -
my old 2011 MacBook with all my childhood memories (i had it when i was 8, im 14 now) just died, can't access the hard drive and it has like 80 bad sectors, running Kali off a USB stick to see if i can salvage any data but i have to install apfs-linux to read apple's file system. currently stuck on installing clang for like 15 minutes2
-
Do you think which GNU Autotools is slow in supporting the compile_commands.json (needed by many C/C++ auto completion systems) because is mostly used by Clang users?2
-
What the hell is wrong with the CLang standard libraries? Whose crazy idea was it to put memset and memcpy in the string library?
-
Do only developers have to do such tasks like Cinderella sorting out the lentils from the ashes?
Poor co-workers
* who had to program against the undocumented closed, ever changing API from Exchange Server, supporting over a decade old versions
* who had to compile a c++11 compatible clang or gcc on some sick old OS and almost got it working with compiling a fresher gcc with one that got stuck in one of the build stages. -
Spend like 3 weeks in mem-checking with valgrind and ASAN, because there seemed to be some leaks. So painful and scary. You loose all confidence in your software, the checking tool, your own sanity.
Some spurious result prevailed, could only move it around. Boss could not reproduce the problem on his machine; Ubuntu 18 with GCC 7, mine was Debian 9 with GCC 6, so I tried older Ubuntu with GCC 5. Also no problem.
Fuck it, I'm switching to clang.