Show newer

@andrew very cute kid and that is an immaculately decorated cake! It’s always fun to see them try to eat cake on their own.

My youngest will be one next Feb and I can’t wait to do the smash cake one last time!

@kylewritescode Two things this week:
- actually take notes for my Calc course so I can bake the material into my brain better
- do 1 coding challenge in C and one in Python to get some practice

What are your plans work, learning or otherwise?

@LouisIngenthron Thank you, that is really helpful. It makes sense but I didn’t realize the linker came at the end. That explains why it wasn’t generating a map file when I had a compilation error.

The header file thing is interesting to me too. So if I include a header and the function is defined elsewhere it while find the function definition and paste or link it into the file that calls that function?

Thank you for responding and taking the time to explain how this works. I was at the point where I didn’t even really know where to start looking.

@PHolder Thanks for the link to the book and the explanation. I guess my IDE is generating a makefile for me so that explains a lot. I will look at CMake because I think that is the one I’ve heard about most and the K & R book.

I appreciate the explanation. I wasn’t fully appreciating what was going on below the surface. Thank you!

@derickflorian Frequently C projects with more than one file are managed by a Makefile. You define the rules by which your project gets built based on what files depend on what other files to compile. When you run the make command, it will comprehend the dependencies, check the file time stamps, and figure out the minimum amount of work to build the project. There are also newer technologies that have developed, see CMake, ninja, tup and others as well as Visual Studio.

@derickflorian Been a long time since I've worked in C, but if I recall correctly, it processes all of the header files first, using them to build a map of functions and variables and classes that can be invoked (and which external libraries they require).

Then, it compiles the actual code files down into machine-readable binary code.

Then, the linker goes through and actually links that map from the headers with the built code (and any included libraries).

So, yes, the names of the c files don't matter that much. The names of the header files matter, primarily for include purposes.

In C++, the names of the cpp files matter more from a style perspective because the classes are more self-contained and should generally be in matching code/header files.

@gnusuario ok, that makes sense. Although the file is in the project directory I have to manually add it to the project in the IDE I’m using.

Choose your fighter. #Poll #Polls #MastoMonday

@Schiracha Welcome! My wife got unlucky in that we have three boys. I appreciate not having to deal with 2 sets of parent challenges(boy and girl) and the nice pipeline of hand me down clothing we established. :)

I’m making progress but without really understanding the big picture for now.

When you build a C project does it look for the header files first and then find a matching definition in a C file, then linking and compiling based on that?

I did an experiment where I changed the name of the .c file and it worked fine regardless of the name. So is it the header file name that matters the most?

I’m learning as I go so I apologize if I should have read this in a book or manual somewhere. If there is a helpful resource I would appreciate a link to it please. :)

Good post about exploiting the Wi-Fi stack in a Tesla Model S (2020). First exploits the Wi-Fi firmware, then the host. Firmware vulnerability is the 802.11e (WMM) functionality when handling ADDTS and TSPEC frames, host vulnerability in the driver.

keenlab.tencent.com/en/2020/01

A memcpy will copy all bytes except the header. The number of bytes to be copied is calculated as "to_copy = length - 4". But when the packet has no or an incomplete header, this calculation overflows, leading to a heap overflow.

@angelobottone I am glad voters are having success in pushing back against what is showing to be an unpopular conservative agenda. As you mentioned packing the courts will definitely work to an extent but eventually I have faith that we can get around tricks like that.

I wrote a flash cards app with some highly opinionated design choices:

It's very performance focused and has no noticeable latency even with thousands of cards, due to using segment trees.

The cards are stored in an SQLite database so you can edit them with your favorite DB GUI or the sqlite3 CLI.

It's written in C because why not.

You can find the code here: git.exozy.me/a/SDC

Just shopped in Duluth Trading for the first time. It was amazing and I immediately sold my house and left the suburbs for a ranch.

Hi! I'm a Game Developer / Designer & Pixel-Artist. #Introduction
I use MsPaint for PixelArt and Unreal Engine for games.

Working on Unreal Racing: linktr.ee/UnrealRacing

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.