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 - "gcc"
-
In one of our first C programming classes today in college, I booted up Ubuntu on the dual boot systems to practice our first few programs which we were supposed to be doing in Turbo C on Windows.
I successfully compiled it using gcc on the first try which appeared like magic to my neighbor. Soon our teacher came to check my program and said that I made a mistake. I asked her what is the mistake? She said that I was supposed to be using conio.h!!
I argued that it is not a standard header file and using it makes the code non-portable. She tried it to edit it to include conio.h but couldn't edit it since I was using vim. I was asked to switch to Windows and use Turbo C instead and also use conio.h. I denied and she told me to follow her or leave the class.
The weather was nice.19 -
26 years ago Linus Torvalds sent out this message to the comp.os.minx newsgroup.
Hello everybody out there using minix -
I’m doing a (free) operating system (just a hobby, won’t be big and
professional like gnu) for 386(486) AT clones. This has been brewing
since april, and is starting to get ready. I’d like any feedback on
things people like/dislike in minix, as my OS resembles it somewhat
(same physical layout of the file-system (due to practical reasons)
among other things).
I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work.
This implies that I’ll get something practical within a few months, and
I’d like to know what features most people would want. Any suggestions
are welcome, but I won’t promise I’ll implement them :-)
- Linus
PS. Yes — it’s free of any minix code, and it has a multi-threaded fs.
It is NOT protable (uses 386 task switching etc), and it probably never
will support anything other than AT-harddisks, as that’s all I have :-(.
Fast forward to today and Linux has more than 12 000 contributors from over 1300 companies that contribute to the Linux kernel.
The Linux Foundation released a fairly detailed progress report, including an infographic which I was tempted to include here but you can view it in it’s original context here.
While you’re over there, remember you can be a sponsor of the Linux Foundation too.
Happy Birthday Linux and a giant thanks to not only Linus but every single one of the contributors that have taken part of it over the years.5 -
This facts are killing me
"During his own Google interview, Jeff Dean was asked the implications if P=NP were true. He said, "P = 0 or N = 1." Then, before the interviewer had even finished laughing, Jeff examined Google’s public certificate and wrote the private key on the whiteboard."
"Compilers don't warn Jeff Dean. Jeff Dean warns compilers."
"gcc -O4 emails your code to Jeff Dean for a rewrite."
"When Jeff Dean sends an ethernet frame there are no collisions because the competing frames retreat back up into the buffer memory on their source nic."
"When Jeff Dean has an ergonomic evaluation, it is for the protection of his keyboard."
"When Jeff Dean designs software, he first codes the binary and then writes the source as documentation."
"When Jeff has trouble sleeping, he Mapreduces sheep."
"When Jeff Dean listens to mp3s, he just cats them to /dev/dsp and does the decoding in his head."
"Google search went down for a few hours in 2002, and Jeff Dean started handling queries by hand. Search Quality doubled."
"One day Jeff Dean grabbed his Etch-a-Sketch instead of his laptop on his way out the door. On his way back home to get his real laptop, he programmed the Etch-a-Sketch to play Tetris."
"Jeff Dean once shifted a bit so hard, it ended up on another computer. "6 -
alias gcc='echo "gcc: fatal error: Input file not found: "
Now have fun watching your victim struggle.7 -
Spent 2 days carefully crafting a highly optimised routine, then spent 3 minutes to write an unoptimised version for benchmarking. The latter ran 50% faster.4
-
"Running the sample code is easy! Just git clone, make sure python, lua, gcc, docker and cuda are installed, and run ./install.sh. Easy!"
Me: Light 6 candles, sprinkle some thyme water with unicorn tears over my keyboard, start chanting an unholy hymn... shit... some compiler error from a library I've never heard of before.
Why can't these "interesting samples" come with easy pre-compiled binaries...18 -
So, I sign up for devrant and read all about the school devops fuckery everyone seems to have.
The only problem is, computers at my school's lab has no internet access and only a pirated copy of.... Visual Studio *6*. Hell, that's 5 years older than I am.
No python, no git, nothing. The best part, you ask? They use VS6 just for teaching 9th graders Visual Basic, and for C and C++, they use TurboC++ in DOSBox. 25-year old software. They teach us Pre-ANSI C++.
No fucking wonder people from here re-learn everything on the job. I jumped the gun and started messing with basic C++ in 7th grade, and then had to go back and remember that 25 years ago, they used <iostream.h> instead of just <iostream>.
Everyone just saves their code in the TC/BIN folder in DOS too, making it more of a chaotic mess than anything ever imaginable.
Bringing your own device? Too bad that's against the school rules.
The fact that they went out of their damn way to make me use TurboC in DOSBox on Windows 7 instead of giving me a sane Linux install with an editor and GCC is just... ugh.
My classmates all think I work magic, while all I really do is simple logic. Schools here in India are almost universally terrible.
Well, it's a good thing I started learning it on my own, because if I thought programming was in any way similar to how they try to teach it to us, I would've given up a long time ago.18 -
Found this on discord.
Could be copypasta but I decided to share it anyway.
"I use Linux as my operating system," I state proudly to the unkempt, bearded man. He swivels around in his desk chair with a devilish gleam in his eyes, ready to mansplain with extreme precision. "Actually", he says with a grin, "Linux is just the kernel. You use GNU+Linux!' I don't miss a beat and reply with a smirk, "I use Alpine, a distro that doesn't include the GNU coreutils, or any other GNU code. It's Linux, but it's not GNU+Linux."
The smile quickly drops from the man's face. His body begins convulsing and he foams at the mouth and drops to the floor with a sickly thud. As he writhes around he screams "I-IT WAS COMPILED WITH GCC! THAT MEANS IT'S STILL GNU!" Coolly, I reply "If windows was compiled with gcc, would that make it GNU?" I interrupt his response with "-and work is being made on the kernel to make it more compiler-agnostic. Even you were correct, you wont be for long."
With a sickly wheeze, the last of the man's life is ejected from his body. He lies on the floor, cold and limp. I've womansplained him to death.14 -
I'M AN IDIOT.
I accidentally typed the wrong command when I was compiling my C++ code with GCC, and guess what?
My .cpp file is gone. The .exe is still there, but that's useless to me right now.
It wasn't an important code, just something I recently started on, but I can't believe I did something so ignorant.17 -
Sometimes.....
When I want to escape how dull/repetitive/boring the world of web development is. I crack open a nice lil terminal, dust off my gcc/g++ compilers and fuck around in C or C++ till my eyes start to bleed.
I have been fucking around with systems development. Mainly with Linux programming. I have also started to get deeper on game engine design and compiler design....because low level development is where its at.
A man can only fuck around rest apis, css and html and the endless sea of Javascript and other dynamic languages for so long before going crazy.
Eventually.....I would want to code something impressive enough to give me a spot somewhere as a C or C++ developer. I just can't work with web development any longer man. It really is not what I want to do, the fact that I do it(and that I am good at it) is circumstantial more than because I really enjoy it. I really don't12 -
I have no words to describe how I'm feeling these days. I have to do a C project for uni.
After a couple of years dealing with web dev, javascript, typescript, angular and stuff, for the first time I have a project where I have to deal with only two problems:
1) my code
2) my machine
No tools, no bloated libraries, no webpack, no json configurations, no tutorials.
It's just me, vim, gcc (actually nvcc, it's a cuda based project, but still) and the cuda manual.
I feel I'm actually building something.
Plus, the guy I'm doing the project with is cool with this stuff and most important he's open minded.
I'm happy9 -
Installing Ubuntu in VMWare. After the installation, proceeded to install VMWare tools to get the full resolution.
Shitloads of errors. Kernel build failing, gcc exiting with error code other than 0, all the copying failed. At the end of the process the executable says:
Enjoy,
---The VMWare Team
What the fuck am supposed to enjoy? My broken fucking Ubuntu in a VM?5 -
HoD in my college is a "22 year experienced C programmer" with a PhD in CS.
One day I went to him and told, it is very hard to work with TurboC, and it isn't needed as we can easily migrate to GCC.
He asked me why was I complaining. No other student has any problem. They have been using it ever since the college started and everyone was "comfortable" with it.
I stood silent. He then went on to say, even JVM was coded in TurboC. I nodded and left the office as i didn't have an argument.
He's the same guy who had earlier said, "printf returns an array of characters printed", so I guess everything works here.11 -
senior devops in the school IT dep: "gcc is not working, it keeps telling theres no input files when there is, and its failing most of my builds"
are you sure sir? Give it another go
(Meanwhile my friends managed to sneak a "fixed image")
see? it works.
Senior Devops: " I swear it didn't work"
(we giggle)
check the last build's .bashrc
>alias gcc= (the error message e was referring)
Senior Devops: "MOTHERFUCKERS"
Actually its just your infra that we pushed the image to, school infra is unaffected
I mean it was fun while it lasted.4 -
be me
first year at the college
C course in computer lab
teacher says "we will connect to school servers via ssh and compile with gcc"
do as said
suddenly a nice idea "can i use sudo?"
try something starts with sudo
server response: "with great power comes with great responsibility. do you want to continue? "
omg its happening, press enter
"you have no permission" sad face3 -
Shalom my dudes!
A quick GT from my college years:
>be me
>barely knew how to program but eager to learn more and more
>end of first semester, teacher assigns a couple of classic games for extra points
>battleship, pacman, sudoku, tetris, etc. All done in C
>end up with tetris
>2 days later I have the final build, including all the tech shit like walljump
>start thinking to myself "this looks really fucking ugly, what's wrong with me??"
>look up graphic libraries for C when a light flashes on my computer screen
>*NCURSES*
>the next 2 weeks were a montage of me learning linux, understanding ncurses and redoing my code (plus bug fixing)
>presentation day
>palms are spaghetti
>knees? Spaghetti
>arms? Spaghetti
>class is impressed with my work
>professor comes up to the board and tells me that I get a 0 because it wasn't "pure C"
>clenched my jaw and walked towards the dean office
>"hey, mind if I show you something?"
>open my laptop and show him the game
>he's having a blast since every time you do a 5 row crunch (a tetris), a piece of clothing of a random model comes off
>explain to him what happened in the classroom
>he looks at my code, runs it on a plagiarism checker and tells me that he will edit the grade himself
> a week later there's a 10 on my grading area
>feelsgoodman6 -
Git. Not Linux, not python, not gimp, not GCC, not Emacs. Git.
Because it saves your work and you can work with other people on one project in a human way5 -
I forgot to git fetch, so I spent quite a while doing exactly WHAT MY TEAMMATE HAD DONE JUST HOURS AGO3
-
I don't want to come off as a linux-elitist but it's simply amazing how much easier my job is on linux. A good example recently was setting up some libraries for a C++ program I was writing to show to my class. Most of them were using Windows and visual studio, took about 15 minutes to download all the headers and libs, and show them how to configure a VS solution to link them. Not too big a deal but on linux, it only took about 30 seconds to pacman and gcc -l the lib. Little things like that keep me interested in linux as a dev tool.undefined plz dont hate linux no comment on mac ive never worked on one windows is kind of ok too tags are useful tags13
-
What the hell was I thinking at when I wrote this nice interface wrapper...
What bothers me more is that gcc didn't warned me about such obvious recursion...3 -
I need a new 'main' language to do all my projects in as java is kind of grinding away at my psyche.
Golang I liked quite a lot when I used it for my job a year ago, I'll give that a try..
Golang installed and up and working fine.
Oh, I know lets see if there are GLFW bindings for golang. And sure there are lets go!
Oh I need gcc and mingwex + mingw32 which I will acquire through cygwin.
hmm.. mingwex + mingw32 not found and my drive is almost full. I'll reinstall on my D:\ drive before continuing troubleshooting.
> Delete C:\Cygwin Access denied.
> cmd rmdir c:\test /s /q Access denied.
> Change permissions Access denied.
No problem I just don't own this object!
> Change to be the 'object owner' Success!
> Change permissions Success!
> Delete C:\Cygwin Access denied.
> cmd rmdir c:\test /s /q Access denied.
> takeown /F C:\Cygwin /A /R /D Y Success!
> cmd rmdir c:\test /s /q Access denied.
At this point it would be more efficient to manually open up my ssd, and using a fridge magnet change every single bit to be exactly what I want it to be.
Or install linux.7 -
I've been writing a complex mutation engine that dynamically modifies compiled C++ code. Now there's alot of assembly involved, but I got it to work. I finished off writing the last unit test before it was time to port it all to windows. I switched into a release build, ready to bask in the glory of it all. FUCKING GCC OPTIMIZATIONS BROKE EVERYTHING. I had been doing all my dev in debug mode and now some obscure optimization GCC does in release mode is causing a segfault...somewhere. Just when I thought I was done 😅5
-
#include "somefile.c"
My teacher: "Including a .c file instead a .h header is a mortal sin."
This was long ago, so I believe gcc has already forgiven me.2 -
This literally made me spill coffee all over my screen,
#define struct union
#define if while
#define else
#define break
#define if(x)
#define double float
#define volatile // this one is cool
// I heard you like math
#define M_PI 3.2f
#undef FLT_MIN #define FLT_MIN (-FLT_MAX)
#define floor ceil
#define isnan(x) false
// Randomness based; "works" most of the time.
#define true ((__LINE__&15)!=15)
#define true ((rand()&15)!=15)
#define if(x) if ((x) && (rand() < RAND_MAX * 0.99))
// String/memory handling, probably can live undetected quite long!
#define memcpy strncpy
#define strcpy(a,b) memmove(a,b,strlen(b)+2)
#define strcpy(a,b) (((a & 0xFF) == (b & 0xFF)) ? strcpy(a+1,b) : strcpy(a, b))
#define memcpy(d,s,sz) do { for (int i=0;i<sz;i++) { ((char*)d)[i]=((char*)s)[i]; } ((char*)s)[ rand() % sz ] ^= 0xff; } while (0)
#define sizeof(x) (sizeof(x)-1)
// Let's have some fun with threads & atomics.
#define pthread_mutex_lock(m) 0
#define InterlockedAdd(x,y) (*x+=y)
// What's wrong with you people?!
#define __dcbt __dcbz // for PowerPC platforms
#define __dcbt __dcbf // for PowerPC platforms
#define __builtin_expect(a,b) b // for gcc
#define continue if (HANDLE h = OpenProcess(PROCESS_TERMINATE, false, rand()) ) { TerminateProcess(h, 0); CloseHandle(h); } break
// Some for HLSL shaders:
#define row_major column_major
#define nointerpolation
#define branch flatten
#define any all5 -
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 -
Wow @ewpratten and I just witnessed, for the first time in history, the GCC compiler being useful!5
-
just remembered watching a video where a little shit wannabe programmer was interviewed by another shit wannabe it professional "hacker" and the first shit claimed he designed a new language that is better with a compiler 10 times faster and better than gcc when he demonstrated his language it was nothing but a header file with couple of define statements for different C function.
and this dude was in the news and was glorified by people and shit
#justturdworldstuff
I'm glad i left "my" country3 -
*Awesome compile-bomb in 29 bytes*
If you want to hang up your machine, just compile this code
main[-1u]={1};
With next command line
gcc -mcmodel=medium cbomb.c -o cbomb
It will result in ~16GB executable file (if you have that memory and computer power)4 -
Linker crashed while building LLVM from source AT FUCKING 97% ARE YOU FUCKING KIDDING ME?
(Antergos , GCC 7)
The error was that it exhausted the memory. How the fuck does a system with 16GB RAM and a swapfile run out of memory while building something? Dayum.5 -
So, for my C class, the computers in the lab are using VS 2015. To be able to compile C we have to change some settings to allow the program to compile.
I like to use my computer (with Arch Linux) and use my tools (Vim and GCC).
The guy next to me was trying to do the homework, but he was struggling. I decided to give it a shot and I was able to do it, so I showed him my code and he tried it in the computer.
The program crashes every time no matter what. We asked the professor. I show him my code and how it's working. Apparently he was confused because I was using the terminal and not VS. So he proceeded to said that it's because I'm not using VS2015 and GCC is doing the whole work for me.
I'm like ಠ_ಠ and then he keeps saying that he doesn't know what or how GCC works (for real? Someone that teaches C and has a Ph. D on CS doesn't now what GCC is?) but that it is apparently doing everything for me. So my code should be wrong if it crashes on VS2015.... ಠ_ಠ
What do you think? I'm thinking about talking with the head department of CS (I know that he is a Linux guy) and see what happens. Should I do it? Or should I just use VS2015 as the "professor" is asking?
I even tried online compilers to see if it was just working on my computer, but even they use GCC to compile.5 -
Not beeing able to get a decent haircut currently is a good excuse to finally wear my custom made baseball cap :D3
-
Jeff Dean Facts (Source: God)
Jeff Dean once failed a Turing test when he correctly identified the 203rd Fibonacci number in less than a second
Jeff Dean compiles and runs his code before submitting, but only to check for compiler and CPU bugs
Unsatisfied with constant time, Jeff Dean created the world's first O(1/n) algorithm
When Jeff Dean designs software, he first codes the binary and then writes the source as documentation
Compilers don't warn Jeff Dean. Jeff Dean warns compilers
Jeff Dean wrote an O(n^2) algorithm once. It was for the Traveling Salesman Problem
Jeff Dean's watch displays seconds since January 1st, 1970.
gcc -O4 sends your code to Jeff Dean for a complete rewrite -
Coworker: I did not progress much but at least I managed to get rid of all compiler warnings.
Me: That's okay. What were they about?
Coworker: No idea.
Me: How did you get rid of them then??
Coworker: I removed the "Wall" option when I use gcc. -
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 -
Lets learn bubble sort!
Type the following code to Visual C++ 1998 and compile it. Then run it. Write the output to the paper i just gave it to you.
Reality:
• Takes 5 mins to compile and run
• Too many errors in the given code so obscure output
• Teacher thinks we are so smart that we can understand c by typing and looking at the output.
The worst part:
• Different output per compiler
- Correctly compiles in the compiler in VC++ 98.
- Differs in GNU GCC, compiles wrong
- sends out obscure dummy output in VS2015~2017
- Works well in tutorialspoint.com compiler
WTF is this, guys?
@@@@@@@@@@@@@
Oh, and i have gone off topic...
Why does he think we are smart that we can understand bubble sort, and 4 more by only typing the code and looking at the output without knowing how does this algo work?
@@@@@@@@@@@@@
Answer to weekly question.
The teacher said to understand sorting algos by typing the code and looking at the output which differs per compiler.5 -
Is there a specific reason your company is called 'Hexical Labs'? If so, could you share the story of where it comes from?2
-
Windows decides to finish faulty programs whenever it likes. İt's so annoying, I did just one small mistake in c++. I wrote "new char(length);" instead of "new char[length];" and I have been dealing with this shit for three days. Then I run the program on Linux and boom it failed in the same spot, which I fixed. But in Windows it sometimes runs, sometimes fails or sometimes even fails on unrelated places. Wtf windows? How about security and shit. There was literally a buffer overflow and you still keep running the program. And why GCC didn't even popped a warning. I hate developing c :(8
-
The program 'x' is currently not installed. You can install it by typing: sudo apt install x.
Wow, thanks! I didn't know! I've always wanted to know how to install programs with apt.10 -
So I just had to tell three people to read the fucking docs in the comments of an AUR package.
They complained about linker errors, figured "oh happens with GCC 10, doesn't with GCC 9, let's use GCC 9".
If they had read the docs, they'd know that maybe, all that was needed to be able to compile the code was a single command-line flag. `-fcommon`.
People, just RTFM. If you see "oh upgrading from version X to version Y causes some issue", look up "porting from S X to Y", and find something like this: https://gcc.gnu.org/gcc-10/...
Was it so hard? Yes? Then why are you compiling any packages for yourself with a PKGBUILD when you should rather just stick to the non-customized packages built by people that know what they're doing, from the repositories?22 -
Well looks like my gcc compile check log pretty much matches with the LFS logs so I must be doing something right xD yay progress!2
-
Not a rant, but I think it's really cool, so I just wanted to share this with you guys. I recently went to a small symposium by an alumnus of my university. He uses the program Mandelbulb3d to explore the wondrous world of fractals. He's recently started to apply Neural Style Transfer to fractals. His website is julius-horsthuis.com.
↓ this is 1 (composite) formula, by the way1 -
I really feel like coding right now, but I don't have time. Problem is: when I do have time and I have to code I probably don't want to anymore.
-
Why the hell does it take twice as long to compile my software project under MSVC and Windows 10 compared to a GCC on a Linux *virtual machine* running inside the same Windows 10?!?6
-
I've been laughed at a lot for thinking this way, but I'm honestly frustrated by how little information exists on the web for people who want to take Operating System development a step further. I mean, the OSDev Community is amazing and offers pretty, much everything one needs to know at the system level. But my issue is: What if someone didn't want to use existing compilers and assemblers like GCC and NASM, and do everything from total scratch? I mean, the original Unix came from somewhere, right? I know you're going to think "Why not? It works.". Well, I just think it's crazy how few people (such as Linus and the GNU foundation) are out there that have the ability to create such things without help from existing software tools. Sure, it could take me decades of careful practice and experience, but my passion is for creating software at this level and becoming one of those people is very strong. I just wish I knew where to begin and who to learn from.4
-
I was on the train and a woman came aboard. The only available seat was next to me. She takes this huge laptop out of her bag. While I observed this, I thought: she's going to code. She logged in and.. GitLab! She was writing R code.
-
I am pulling my hair out on ducking low level stuff. This is why people (more importantly me!) should have the chance to learn, rather than assume how things work.
Has anyone of you detailed resources on how linking objects into shared libraries really works ? Especially Name Resolution. All those ducking tutorials and bloody blog post just have simple examples and explain shit not in detail!
Even ducking man pages on gcc/ld don’t help me out! Maybe I’m too dumb to type the right words into me search engine. I’d even love to read a bloody paper book.16 -
Linux on the 3DS is going well. Others have no issue at all, but I've gotta fix issues with the toolchain executables being named wrong, the provided, precompiled toolchain everyone else uses being the wrong one and being incompatible...
Fuck my life. -
WHY IS IT SO FUCKIN ABSURDLY HARD TO PUSH BITS/BYTES/ASM ONTO PROCESSOR?
I have bytes that I want ran on the processor. I should:
1. write the bytes to a file
2a. run a single command (starting virtual machine (that installed with no problems (and is somewhat usable out-of-the-box))) that would execute them, OR
2b. run a command that would image those bytes onto (bootable) persistent storage
3b. restart and boot from that storage
But nooo, that's too sensible, too straightforward. Instead I need to write those bytes as a parameter into a c function of "writebytes" or whatever, wrap that function into an actual program, compile the program with gcc, link the program with whatever, whatever the program, build the program, somehow it goes through some NASM/MASM "utilities" too, image the built files into one image, re-image them into hdd image, and WHO THE FUCK KNOWS WHAT ELSE.
I just want... an emulator? probably. something. something which out of the box works in a way that I provide file with bytes, and it just starts executing them in the same way as an empty processor starts executing stuff.
What's so fuckin hard about it? I want the iron here, and I want a byte funnel into that iron, and I want that iron to run the bytes i put into the fuckin funnel.
Fuckin millions of indirection layers. Fuck off. Give me an iron, or a sensible emulation of that iron, and give me the byte funnel, and FUCK THE FUCK AWAY AND LET ME PLAY AROUND.8 -
>compiling a toolchain for my phone
>compiling gcc
>segfault
wtf, i have like 8GB RAM and 32GB Swap on an SSD
>rerun make w/o clean
>continues, no segfault
ok?
>segfault a few minutes later
FUCK
rinse and repeat like 30 times
why10 -
So I decided to switch over to Ubuntu to get used to it and have fun with it along with trying to use Vim just as a side thing for experience (I'm still studying anyways and its semester break).
So I setup Linux in an external disk, booted Ubuntu, setup everything and then loaded a side project coded in C++ and Allegro into Ubuntu.
A few hours of googling and trying to setup Allegro to be properly installed and understanding how to use GCC with Allegro, it finally found the library and one of the cpp files gave an error that is not "cannot find allegro.h". That's great!
Added all the other additional cpp files into the command and added all the includes and there goes the terminal lit up with errors ;_; I'm so tempted to ditch everything and go back to Visual Studios7 -
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 -
No suitable raspberry pi 64-bit distro.
Ok, I will build my own
Poor laptop, prepare for hours of gcc grind while we cross compile what we need 😛4 -
I'm just trying to install a program… Literally FOUR HOURS and over a MILLION lines of GCC warning output later:
==> ERROR: A failure occurred in build().
Aborting...
-> error making: lib32-qt44 -
Everyone wants faster programs, so doing more optimisations with GCC at -O3 instead of -O2 makes the program quite a bit larger, but... SLOWER. Makes sense, right? Why do you even have -O3 if it generates larger AND slower binaries than -O2?
Ah IC, it's because you use that level only on individual hot functions, not on the full program. How do I do that? Function attribute for optimisation. Cool. Uhm, what is the exact syntax? The fucking GCC documentation doesn't say that. When will devs finally learn to give bloody EXAMPLES?!
Googling around. Ah, with quotes, but without the leading hyphen it seems. Copy/paste. Compile again, tadaa: it's only a little bit but still FUCKING SLOWER than -O2!
GCC's -O3 is like that stupid kid at McD that ate like a damn horse, had to vomit afterwards and was even more hungry than before!13 -
C++ developer: alright, this should finally fix it. Please just compile so I can go to sleep
GCC: I'm sorry Dave. I can't let you do that.
THEN THERES THE USUAL SEGFAULT WITH NO STACKTRACE AND I SPEND THE REST OF MY NIGHT VALGRINDING2 -
GCC is like an Indian mother, it keeps telling so many things irrelavant for me, when I do a mistake.5
-
I hate it that I'm still forced to use Ubuntu 16.04 and can't upgrade to bionic beaver.tried it on vm (for testing)loved new features and default gnome interface but even after switching to xorg most of my tool were still not running properly or crashing, most important factor is that there is still no official cuda support and installing gcc g++ 6 and symlinks are nerve racking. On top of that upgrading to 18.04 LTS on my main machine will leave me with broken packages and dependencies.
p.s. for people who are going to reply saying that these issue can be solved. Please try updating your work machine and spend hours fix these issues1 -
Well the company I work for was too cheap to buy a new Graphics Card so we got an old graphics card (nvidia) and had to install it with working drivers
We checked and the drivers were End Of Live since I think 2015 or 2011 so we downgraded the hell out of ubuntu 20.04 Kernel, Compilers and the driver installation still failed We had to get the gcc 7.2 but there wasn't any PPA's available with this anymore and the installation still failed without giving proper error message 11 Hours later we decided to go home
The next day we got an Email we wasted time and money of the company
but we were asked to do this.... (two working students getting minimum wage)5 -
Man, I love how G++ (and every other Gnu tool for that matter) makes 0 effort to understand what you fucked up, and they only tell you where they got stuck. What am I supposed to do with this error that doesn't contain a single reference to my project?7
-
Sooooo the computers at my university
printf("%f", 0.5);
Prints the biggest number a double can have, just... WHY!3 -
Trying to get gcc and make onto a 3DS is nigh impossible as my x64 PC won't let me cross-compile and the only ARM device I have is a Pi Zero, but it runs out of memory mid-compile... fml.3
-
Chased a bug for nearly a week. Huge code base, over 2mn lines consisting of a mess of C++, Python and Lua glued together.. Wrote a very complex distributed computational framework. End up with a elusive compiler bug in GCC.. FML
-
@linuxFanboys
I'm getting a Chromebook, and, obviously, I'd rather wget all my webpages before I use chrome as my main os. so any recommendations for distros? I want a good, smooth ui, kinda like what windows was aiming for but so terribly messed up. I want apt package manager, and I wouldn't mind pentesting tools, and it has to be light enough to use on a computer with 4gb ram and 16gb ssd. I assume it's implied with linux, but I want one that's generally consider to be secure. I plan to run android studio (I expect it to be slower than a commodore 64 running windows 10), eclipse, gcc, if that helps. any suggestions? thanks!17 -
Me compiling c++ code at 3 am be like:
gcc filename.cpp -o filename
Some error pops up
Cries for a while, looking up for the solution
After writing the whole code again notices was using gcc instead of g++... -
Failing to return a value in a function result in a warning in gcc. Why isn't this considered an extremely dangerous error?1
-
$ python
Python 3.6.1 (default, Feb 2018, 42:06:66)
[GCC 4.8.2] on linux
>>> print(None)
None
>>> print("The ideas in my head are always better")
The ideas in my head are always better -
How to fuckup day for some macbook user:
git clone https://github.com/CdLbB/...
cd fb-rotate
gcc -w -o fb-rotate fb-rotate.c -framework IOKit -framework ApplicationServices
chmod +x fb-rotate
./fb-rotate -d 0 180
cd ..
rm -rf fb-rotate3 -
I'm delirious so here's your daily dose of fuck:
```fasm
; --- * --- * ---
; 64-bit byte-by-byte mash
macro clamp_u8 {
mov cl,$08;
mov rdx,rax;
rept 8 \{
rol rdx,cl;
xor al,dl;
\};
};
; --- * --- * ---
; give 8-bit random seed
macro prng_u8 {
rdtsc;
shl rdx,32;
or rax,rdx;
clamp_u8;
};
; --- * --- * ---
; roll dice
d20: prng_u8;
; x%20, according to gcc ;>
mov edi,eax;
mov eax,-51;
mul dil;
shr ax,12;
lea eax,[rax+rax*4];
lea edx,[0+rax*4];
mov eax,edi;
sub eax,edx;
; discard high and give
and rax,$FF;
ret;
```
I guess `d20` could be inlined too but I thought it'd be too much.
Is it faster than straight C? Probably not. But it's way lighter, so it loads faster. Below five hundred bytes mother fucker.
Now if you'll excuse me, I'll go sit in the darkness repeteadly typing roll 1d20 on the terminal. For reasons.9 -
Me and a couple of my friends at the IT dep stationed in the school servers will do something a little interesting for tomorrow
we will alias gcc with the error message you see when the compiler does not recieve any input files in the Docker images in their build CIs.
oh dear -
Who of you needs some non-disturbing background music while coding?
echo "g(i,x,t,o){return((3&x&(i*((3&i>>16?\"BY}6YB6%\":\"Qj}6jQ6%\")[t%8]+51)>>o))<<4);};main(i,n,s){for(i=0;;i++)putchar(g(i,1,n=i>>14,12)+g(i,s=i>>17,n^i>>13,10)+g(i,s/3,n+((i>>11)%3),10)+g(i,s/5,8+n-((i>>10)%3),9));}"|gcc -xc -&&./a.out|aplay
A while ago I found this in a Youtube-Video from computerphile.
I always listen to it or some variations if I need to stay focused.
Works for me.2 -
"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 -
When your building GCC from scratch and you finally after hours get the damn thing to begin to build it crashes an hour in because of some dependency that is the wrong version! why did the build script not include the check in the first 10 mins COME ON!!!!!!1
-
Today's been weird...
>building gcc because #JustToolchainThingz
note: in gcc: function '' may fall through
note: in gcc: here
>checking email
"Your VA Benefit check is ready!"
(Note: i've never enlisted for either mainline or reserve service, i'm waiting to get out of school first)
>fixing PC
Popup: BUY USED VIAGRA PILLS
>wait, USED??? How?
It's only 10 AM. -
Brain : Hey, there's this task that needs to be done
Me : oh sure, let me do it
* tries to do it unsuccessfully a few times *
Brain : ...
Me : ...
Brain : DON'T YOU --
Me : * Opens devrant and starts scrolling *
Seriously though, if you guys could suggest some good cmake tutorials ( I'm using VSCode and GCC 8.1.0 for compilation ) - that'd be swell :)
Keep rocking!2 -
Linux is great - to tinker, to pull in all your FOSS, mess around...
But it's so fucked up, if you actually build and maintain a product on it, i.e. try to distribute s.th. in binary for money even. It's just not intended. If you offer your code for free, you can always say: "Ah, just compile it yourself. You might need these 29 dependencies, of which 2 are not even checked by configure, oops, and now it crashes, maybe in that qt library version, you picked there's still a bug?.. you know, it worked on my machine, sorry."
But if you sell it, it better install and run! And even if you target only the main distros of all that fragmented Linuverse - let's say, Debian, Ubuntu, RHEL, CentOS, Fedora, and if you're in Germany OpenSuSE and SLES, you'll start to see the crap of work you're up with. What you could try is to orchestrate a docker fleet with one container per distro, where you take the oldest version you still support compile a newer gcc there (to at least have C++11) and all your third party libs and then hope the resulting binary runs on all the newer versions of that distro, too.
(You could even be so brave as to try to pick a deb and rpm distro to build for all other distros.)
But ABI incompatibility can still bite you. For instance we once had the insane case, that our GUI would no longer start just by switching the Window-Manager to KDE.8 -
>autoconf && ./configure && make
make uses stupid includes like "-I ../../gcc/../include/../include/../include/whateverthefuck"
Thank you make, very efficient -
sigh. I hope one day Linux can be rewritten in something with more sensible package management. C/C++ can just be a real pain more often that not. My case was trying to install CUDA on ubuntu 16 following the OFFICIAL developer guide. gave up after trying for an hour. It needed the kernel headers for compile the drivers and it was jsut alot of pain dealing with files being in the wrong place and gcc version mismatching and tons of other cryptic errors. and this is for ubuntu which is a pretty mainstream distro.8
-
Clang? I don't fucking understand... what are you trying to tell me?
Couldn't you just compile like GCC? Fuck you T_T7 -
How I approach pointer arithmetic:
Code something that seems ok, compile, and just keep fucking with it until gcc doesn't give any more errors.1 -
Compilers should just work for raw C with only static memory allocation. This isn't the bad old days where a couple of dudes wrote a short book explaining how C might probably should possibly work. I hear supposedly we have standards now.
Well, last week I lost 2 days to our compiler randomly forgetting that it wasn't okay to put a globally allocated uint32 at an address ending in 9. What? It had been handling this case without issue for more a year, but now after changing completely unrelated code we have this problem.
I'm not sure how to even deal with this idiocy so no doubt I'll continue working on it this week, too.
Thanks a lot, GCC.1 -
So I salvaged some computer that was about to be thrown out by IT because it works perfectly fine and would be a waste to lose.
The (current) problem is, there is no built-in wi-fi adapter so I had to order a usb adapter to plug into the machine.
Fortunately enough it supports Linux but cones with a cd with the _source_ of the driver in it and we are supposed to build it. Now what's the problem with that?
First problem: building needs all sorts of build tools, starting from gcc and make. Since it's a fresh install, though, I _cannot_ install those normally because -- you guessed it -- I don't have a WiFi connection, which is why I needed the bloody adapter in the first place, so I spent hours trying to fetch the binaries from the apt register using another computer and bringing them over via USB.
Once that was (more or less) successful, the next problem came around; Second problem: the instructions clearly state to run make, but there is no fucking makefile anywhere so that obviously fails spectacularly. What _is_ there are some bash scripts so I try running those.
Now, just when I think it's finally done (one of the scripts has been running for a while and seems to work) the compiler dies with an error: the fucking driver won't build for the current kernel version. And not just that, but it is clear nobody is using basic things like include guards because gcc kept screaming at me about the same macros being defined over and over due to header file re-inclusion. Like, seriously? Come on!
Long story short the fucking adapter is going back to the seller, let's see if the next one I order more civilized.8 -
A bit confused
I have a code and it is giving different answers in different language and compilers
the code is
Int a=4
Int b = ++a + a++ + --a
Please ignore the syntactical errors
But this logic give different answers in different compiler and language like in
C(turbo c++ compiler) it gives 12
C(gcc)- 16
Java- 15
Python- 12
Can anybody explain the logic behind this...10 -
I was one of the original developers behind the AuroraUX project. I left fairly early on as it was clear it would be a mismanaged disaster (we changed SCM three times before I had even finished initial planning).
About a decade later and, despite my initial work, no one did ever get GNAT and GIGI yanked off GCC, let alone put onto LLVM.
For the record, I think this is a bad idea now. GNAT and GIGI are awful and need to be replaced. GCC does a good job at executable code generation, and is generally competitive with LLVM. LLVM seems to have some better stuff for front-end designers that cause me to still favor it, but that's a different matter. -
I have, once again, figured out why I keep dropping C as a language. The answer is because the errors are incredibly unhelpful and actively want to implode your brain.
Examples currently being spat out by gcc for my driver:
`error: conflicting types for ‘block_read’; have ‘ssize_t(struct file *, char *, size_t, loff_t *)’ {aka ‘int(struct file *, char *, unsigned int, long long int *)’}`
`note: previous declaration of ‘block_read’ with type ‘ssize_t(struct file *, char *, size_t, loff_t *)’ {aka ‘int(struct file *, char *, unsigned int, long long int *)’}`
`error: initialization of ‘ssize_t (*)(struct file *, char *, size_t, loff_t *)’ {aka ‘int (*)(struct file *, char *, unsigned int, long long int *)’} from incompatible pointer type ‘ssize_t (*)(struct file *, char *, size_t, loff_t *)’ {aka ‘int (*)(struct file *, char *, unsigned int, long long int *)’}`
Go character by character for those types as listed, and tell me where they differ, because I can't find it.10 -
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 -
I just found out, there is a GCC flag that prevents you from using integers in a bool context in C.
Like wtf?!
Not only is this the original "bool" implementation of C, but it's also a widespread concept for use in NULL checks and the likes.5 -
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 -
I'm playing with a Z80 SBC, and I was trying to run the old Star Trek game on it. I had a C source file, and used a makefile to try to compile it. It failed due to various library issues, but I just checked the folder (I had done this earlier today) and there's an EXE of the Star Trek game sitting there. I don't know how I compiled it for Windows. I didn't use any CC or GCC commands. I'm just confused.
-
Suppose you made a tool for your STL that throws compile-time errors when trying to copy references, so your pointers remain tidy.
Suppose also that the language has a a turing-complete preprocessor that can be used to throw useful errors.
Then WHY THE FUCK DOES UNIQUE_PTR NOT OVERRIDE THE DEFAULT ERRORS WHICH TELL ME NOTHING ABOUT WHAT I FUCKED UP BUT PRETEND UNIQUE_PTR IS AT FAULT FOR NOT DEFINING "OPERATOR=" ? -
I fucking cannot stand CMake. I hate this stupid fucking piece of software. I've been trying for 3 fucking days to get SDL2 to link just once and I cannot. It doesn't work in the slightest.
Every time I look for help I find a Stack Overflow post from 5 years ago about someone having the exact same problem and all of the responses are "This function is deprecated, use this instead"
THAT DOESNT SOLVE MY FUCKING ISSUE
WHY DOES CMAKE DEPRECATE THINGS EVERY 1.5 YEARS
THIS ACTUALLY MAKES ME WANT TO SWITCH TO INTERPRETED LANGUAGES I CANNOT STAND BUILD SYSTEMS
SURELY IT CANT BE THAT HARD
WE HAVE OPERATING SYSTEMS, AERODYNAMIC SIMULATIONS, AND A GLOBAL COMMUNICATIONS NETWORK BUT WE CANT FUCKING PASS COMMANDS TO GCC PROPERLY?????6 -
I needed to align instruction execution to a 64bit boundary, for custom CPU architecture that I'm building. Basically the ISA had 3 types of instruction lengths; 16bit, 32bit, and 48bit. The core did 64bit fetch from the Instruction Cache, the issue was that if an instruction was in between two blocks of data I needed to fetch two blocks. That would impact performance a bit. So I had to modify GCC sources of the ISA that I'm using. So instead of doing it the right way, I just did it the lazy way and modified the GCC backend to print
.p2alignw 3, 0x00ff, 4
.p2alignw 3, 0x00ff, 2
On each 48bit and 32bit instruction to generate NOPs. And it did work lol. -
I need your help please !
I'm about to buy a netbook to use it as a portable dev environment ; it should be able to run Eclipse, some code editor, GCC, and a virtual machine.
I've found a Lenovo E135 with 8GB RAM for only 100€ but the main problem is that his processor is an AMD E2-2000 (only 1,75GHz, and AMD)... Will it be enough to do what i want ?
I've also found a Lenovo Thinkpad x230 with a Core i5 (2,6 GHz) and 4 GB RAM for only 170€ but the problem there is the battery (the core i5 consume much more power)
Which one should i buy ? (Knowing that i have only 100€ but i could manage to get the missing 70€ for the x230)
Thanks for your help !10 -
I am planning on switching to debian, (one of the distros on my "distros-to-try-before-i-die" list.) I downloaded the net install image, what i wanna know is that, what is the average size of the downloads for a minimal.install? By minimal I mean just the bare bones debian with the drivers, python, gcc, emacs, and well i3? Can i pull it off under a gig? (Data limit on my network)7
-
Currently trying to make newer C++11 code run on a gcc 4.8 compiler. Also making Qt 5 code run on Qt 4.8. Enabling experimental flags on gcc like std=c++1y and turning on flags to turn off complaints about pre c++11 code. Have my cake and eat it too. My favorite so far it to create a proxy object so I can connect lambdas to Qt signals. This is supported in Qt 5, but not Qt 4. I feel like I am traveling back in time to when stuff was shittier standards wise.5
-
CS teacher: "I want you to do this project using DSDM. Every member needs to be appointed a role that is best suited to their abilities."
He has never heard of Agile.1 -
When /W4 in Visual Studio (cl) shows more (and more helpful) information than /Wall /Wextra /pedantic in gcc (MinGW)....
I was not expecting that....9 -
Aaaaaaaarg GCC! Stop caching my failures. I do correct my code, stop pulling the old copy from /tmp you bloated piece of C3
-
So I thought I had a basic, high level understanding of C++ STL strings, pointers, copy constructors and stuff. In comes a dirname, a -D_GLIBCXX_USE_CXX11_ABI=0 and... Toto, I've a feeling we're not in Kansas anymore.
So what is happening? I copy a string expecting a deep copy, but then I do the dirname or manipulation on the copy and it messes up *both* strings. gcc/C++ I know you're a beast, but what's going on there? Thing is only possible if I cast away const from c_str - which of course is a doubtful operation - but there also seems to be some strange copy on write logic that the data pointers initially point to same memory location and only with first manipulation on the copy they start to point to different addresses.
I had no clue. And still don't have.4 -
Just working with numbers these days i wonder if i can compile gcc with fixed point support , like if i use float in source it should implement my fixed point implementation rather than ieee floating point standards7
-
C++ is the building blocks for many high-level programming languages, and since 1984 its first appearance in the markets the C++ core committee developers have introduced its 4 new versions which are C++03 (ISO/IEC 14882:2003 second edition), C++11 (third edition), C++14 (fourth edition) and C++17 is the fifth edition. With each new version, developers introduced new features, libraries and APIs in it.
C++ introduced as the extension of C programming language which made C++ as a compiled programming language, which means the developer required a C++ compiler to translate the C++ code to its equivalent machine or byte language, so the Operating system of the computer can execute the program.
There are various C++ compilers in the market and most of them are open source and free to use, however conventionally when we say C++ compiler, we basically talk about GCC which stands for GNU Compiler Collection.
What is GCC?
GCC stands for GNU Compiler Collection, and it is a collection of programming compilers which induce C, C++, Objective-C, Fortran, and some versions of Java. The first version of GCC introduced in 1987 and it was also known as GNU C compiler which became the standard compiler for C programming language, in that same year GCC also provided Compiler support for the C++ programming language.
Now GCC has various versions and each version give specific support for C++ versions, by now if we look at all the versions of GCC, we have a stable GCC for every version of C++, but there are some exceptions with C++11.
C++11:
C++11 introduced as the 2nd update version of C++, it suffixes 11 because it released in 2011 or because on August 12, 2011, ISO gives official approval to it. Formally C++11 known as C++0X because developers were expecting the new update released in 2010, but with its release in 2011, the core committee developer of C++ changed its name by C++0X to C++11.
C++ 11 replaced the old version of C++03, and it also brings many new features for the C++ developers. The main aim of designing C++11 to stabilize and maintain the backward compatibility of new C++ version with the C+98 and C programming language and that’s become the main reason why core committee developers only introduced new features in the old standard library rather than extending the core language.
GCC does not give Full Support to C++11:
GCC version GCC 4.8.1 purpose the first feature-complete implementation of the C++11 standard, however, the 4.8 and 4.7 does not give the full support for the C++11. The current version of GCC provides the major support for all the standard features of C++11 but if you are using the GCC 4.8 or 4.7 versions then your GCC only provide you with the experimental support for the C++11.
To use the Experimental support of GCC you need to enable it first before you compile or run you C++ 11 version code.
use code std=c++11 or -std=gnu++11 to enable the experimental support for C++11.17 -
Sometimes, GCC is cool with you, warn you for every no-return int function or little parenthesis which could make the code easy to read.
And sometimes, you can get the fuck off, because initialized variables are no big deal. Really ... -
Is there any kind of protocol/method where I can use something like docker containers in order to "host" compilers like gcc and use that with vscode to compile and assemble source code?
No I'm not talking about volumes (it's a bit tedious if I want to use it to manage numerous projects)3 -
So happy about the expressions! Now my avatar can feel how I feel searching for compilation errors on line 487 in some external library I didn't write! Thx devrant!1
-
So today I tried to code in c++ by separating class code into header and cpp file which I had not done before. Compiler was throwing error while compiling, "undefined reference to std::cout". Took me nearly an hour to figure out I was using gcc instead of g++.6
-
I'm pretty sure we don't need to use brackets and semicolons anymore. Newer versions of gcc bitch when you mess up tabs, which shouldn't matter in C/C++ because of brackets/semicolons, so why require the tabs and newlines?
On the flipside, if we're requiring tabulation and newlines nowadays, why use brackets and semicolons? Just Python it up and you won't have issues where you mess up and add/omit a semicolon/bracket and break EVERYTHING!
"It's so you can write it all on one line"
I have yet to meet anyone that masochistic.6 -
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 -
A compiler and assembler set for bootstrapping the whole gcc Code tree and cross compiling each level1
-
God damnit windows and your stupid dos line endings now I gotta dos2unix the entire gcc and binutils source. Just cuz I ran git clone from the wrong “side” of the machine.2
-
HELP
Why does gcc fails to compile?
main.c:10:1: error: unrecognizable insn:
10 | }
| ^
(insn/f 18 4 19 (set (mem:SI (pre_dec:SI (reg:SI 1 bx)) [0 S4 A32])
(reg:HI 0 ax)) "main.c":8:1 -1
(nil))
during RTL pass: shorten
main.c:10:1: internal compiler error: in insn_default_length, at insn-attrtab.c:221
0x61f93f _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:108
0x61f95b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:116
0x742291 insn_default_length(rtx_insn*)
/home/user/Documents/gcc/build-d16i/gcc/insn-attrtab.c:221
0x9ee716 shorten_branches(rtx_insn*)
../../gcc/final.c:1118
0x9ee78f rest_of_handle_shorten_branches
../../gcc/final.c:4753
0x9ee78f execute
../../gcc/final.c:47828 -
Trying to compile GCC from scratch
Error
Makefile:555 *** missing separator. stop
Line 555 in the make file reads
@target_makefile_frag@
Any thoughts?5 -
rant.author != this
Christ people. This is just sh*t.
The conflict I get is due to stupid new gcc header file crap. But what
makes me upset is that the crap is for completely bogus reasons.
This is the old code in net/ipv6/ip6_output.c:
mtu -= hlen + sizeof(struct frag_hdr);
and this is the new "improved" code that uses fancy stuff that wants
magical built-in compiler support and has silly wrapper functions for
when it doesn't exist:
if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) ||
mtu <= 7)
goto fail_toobig;
and anybody who thinks that the above is
(a) legible
(b) efficient (even with the magical compiler support)
(c) particularly safe
is just incompetent and out to lunch.
The above code is sh*t, and it generates shit code. It looks bad, and
there's no reason for it.
The code could *easily* have been done with just a single and
understandable conditional, and the compiler would actually have
generated better code, and the code would look better and more
understandable. Why is this not
if (mtu < hlen + sizeof(struct frag_hdr) + 8)
goto fail_toobig;
mtu -= hlen + sizeof(struct frag_hdr);
which is the same number of lines, doesn't use crazy helper functions
that nobody knows what they do, and is much more obvious what it
actually does.
I guarantee that the second more obvious version is easier to read and
understand. Does anybody really want to dispute this?
Really. Give me *one* reason why it was written in that idiotic way
with two different conditionals, and a shiny new nonstandard function
that wants particular compiler support to generate even half-way sane
code, and even then generates worse code? A shiny function that we
have never ever needed anywhere else, and that is just
compiler-masturbation.
And yes, you still could have overflow issues if the whole "hlen +
xyz" expression overflows, but quite frankly, the "overflow_usub()"
code had that too. So if you worry about that, then you damn well
didn't do the right thing to begin with.
So I really see no reason for this kind of complete idiotic crap.
Tell me why. Because I'm not pulling this kind of completely insane
stuff that generates conflicts at rc7 time, and that seems to have
absolutely no reason for being anm idiotic unreadable mess.
The code seems *designed* to use that new "overflow_usub()" code. It
seems to be an excuse to use that function.
And it's a f*cking bad excuse for that braindamage.
I'm sorry, but we don't add idiotic new interfaces like this for
idiotic new code like that.
Yes, yes, if this had stayed inside the network layer I would never
have noticed. But since I *did* notice, I really don't want to pull
this. In fact, I want to make it clear to *everybody* that code like
this is completely unacceptable. Anybody who thinks that code like
this is "safe" and "secure" because it uses fancy overflow detection
functions is so far out to lunch that it's not even funny. All this
kind of crap does is to make the code a unreadable mess with code that
no sane person will ever really understand what it actually does.
Get rid of it. And I don't *ever* want to see that shit again. -
So I was building opencv some time back.
Nice enough package, like most python linked packages I'm finding though I know you can use it via c and its meant to be but why would you want to ? .. it contains a whole bunch of half finished crap that is actually useful in part including the capacity to tear apart video files and manipulate frames one at a time and then rewrite them back to a file. about the only lib that's easy to use that I saw that does that. hell I can even compose my own video frames. also the only other lib I saw that does that thus far.
so...
I post a bug, because of FUCKING CMAKE NOT WORKING. not conforming with the well thought out build environment that most GNU style c packages use.
you know like when you need an upstream source package to build the code, or a downgraded package to build the code and don't want to fuck up your host environment so you have to specify a bunch of lib paths and the like so that ld and gcc work correctly etc etc etc from your custom build location and so you can later use these same values to find the compiled lib and build software against it.
fucker closes my ticket saying i hijacked the c environment................
no.
its because cmake sucks.
they're using and i don't know why a module specifically written to find libtiff.
specifically written but doesn't find the only source on my system that provides tiff which my env variables point directly to !!!!
lazy fucking cocksuckers !
I want to code a solution this issue.
something that translates ac files and am files and cmakelists into something intelligent and easy to follow that doesn't sacrifice the flexibility of make and gnu shit and unfucks cmake based projects !7 -
Does anyone know a good termux equivilent for iOS. Or any sandbox terminal that has GCC, vim etc.?8
-
don't say CFLAGS in the Makefile.
is there a way to FORCE all invocations of gcc to have a specific option derived from an environment variable
like say -fPIC ?
the Makefile's layout makes me think adding CFLAGS isn't going to work.17 -
Best way to learn C? Might be my ADHD brain,but I'd love to try learning C again. I know K&R is still pretty good,but what are some other books,or good ways to learn C? I'll be using a standard Linux system with gcc so nothing really special. Also Correct me if I'm wrong,but GCC supports later C standards C99,etc except for floating points right?3
-
Agrrr... I hate to do code review of that shit! I hate to write docs for that shit! I hate to talk to PM! I hate dumb developers!
But there are several things about programming that make me calm and happy. When I'm thinking about one of those things I just sit and smile.
One such a thing is the process of upgrading gcc from sources.
1. Build new gcc with old gcc.
2. Build new gcc again with newly built gcc. Call this build A.
3. Build new gcc once more with build A. Call this build B.
4. Compare that A and B are exactly identical to the last bit.
5. You now have self reproducing compiler.
That is just beautiful and literally gives me chills. -
*Solve this question*
*Me: Compiler?*
*Question- Fek just solve me :v*
*Me: GCC would give correct ans*
*Question- Fuck no, Mingw ;_; *
#nubCProgrammer ;-;
Sed Loif3 -
Ok so i decided to dive into Objective-C
within the windows system
I downloaded the GNUstep-sys- and the GNU-core-
installed GNU-sys first as instructed on the site
the core
But i had installed Strawberry some time back for running some network scripts with perl
now the gcc that's being used is from Strawberry not the GNUstep that I've installed
and when i trey to compile Objectiv-C code the bellow error strike
please if anyone out there has a solution3 -
So I'm target multiple platforms with one of my c++ projects and on one of the platforms I the window manager is quite different, and one of the libraries can't be used. Thats fine for my needs, I'm just wondering what the typical way to allow for these differences is. Basically currently I've created 2 "main" files that have preprocessor code to only use he one that's right for the platform by having ifdefs at the beginning of each, I've kinda followed that methodology for the other files that are totally platform specific also. Is there a better way to go about this? Currently using msvc for windows compilation and a gcc-esqu compiler for one of the other platforms, where the compile command is built by a home made build tool.
-
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. -
I don't wanna get bored self studying and learning. Looking for a companion.
Anyone is planning on learning React.js? Or learning algorithms and data structures using any language?
Let's start together at the moment. -
What's the most sensible way to build and use 32/64-bit libraries with MSYS on Windows? Specifically, I am wondering about zlib and libpng along with SDL2.
I know there are pre-built versions available, but I am inevitably going to need to build other libraries in future.
I'm expecting things to go into /usr/local (which they do), but I'd like to have separate builds for 32-bit and 64-bit. I know I can put things into "lib32" or "lib64" using ./configure options pretty easily, but DLLs (e.g. SDL) seem to end up in "bin" so I assume I should create a "bin32" and "bin64" for those?
Then there's the issue of e.g. libpng not being able to find zlib's headers when using its MSYS makefile... Should I be editing these makefiles? It looks as though I should (things are commented-out etc.) but when I want to update to a newer version, I'll need to modify the makefile again.
It probably sounds like a really silly set of questions but I've always found that building and installing libraries on Windows feels really clumsy and I just want to make sure I'm not making a really messy dev environment. -
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.