Notices by Construction Worker (mercurialbuilding@cawfee.club), page 12
-
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 08:04:01 JST Construction Worker @kirby @usernameswift yeah ok I think it worked fuck me
Makefile:
CC=gcc
CFLAGS = -ggdb
CPPFLAGS = -c -std=gnu90 -Wall -pedantic -Wextra
NES = -z noexecstack
mycode.o: mycode.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(NES) -o mycode.o -c mycode.c
mycode: mycode.o
$(CC) $(NES) -o mycode mycode.o
Code:
#include <stdlib.h>
int main(){
int *i;
i = malloc(sizeof(int));
*i = 12;
free(i);
return 0;
}
Compilation Output:
gcc -ggdb -c -std=gnu90 -Wall -pedantic -Wextra -z noexecstack -o mycode.o -c mycode.c
gcc -z noexecstack -o mycode mycode.o -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:58:23 JST Construction Worker @kirby @usernameswift going to kms if the code compiles without needing a cast -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:56:35 JST Construction Worker @usernameswift @kirby I think it's C90
I thought I had to cast it, I'll have to try without. Probably will still want to cast when freeing -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:50:32 JST Construction Worker @condret @icedquinn @kirby Anyways I'm eternally on the edge of dropping this class because it's prevented me from making any progress whatsoever on either of my two theses -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:49:29 JST Construction Worker @icedquinn @condret @kirby This was part one of 5 on the bloody first assignment btw -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:49:21 JST Construction Worker @icedquinn @kirby @condret It was for a school assignment. Had to create an AVL tree data structure from scratch with all the operations. -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:46:31 JST Construction Worker @condret @kirby I guess that makes sense, but what if you allocate things at different times? -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:45:13 JST Construction Worker @kirby @condret Ah in our class we're not allowed to have nested functions, stack frames being bloat apparently
I wanted to kill myself when I was told I needed to implement AVL tree deletion without using a stack or recursion -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:43:54 JST Construction Worker @kirby @condret why have a goto error instead of just return 1 -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:40:06 JST Construction Worker @kirby @condret Can you recommend some firefox plugins or something -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:32:14 JST Construction Worker @condret @kirby idk it's been drilled into my head that gotos are evil and it makes following the control flow confusing and it's like eval you should never ever do it -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:31:58 JST Construction Worker @condret @kirby I worry that ever using a goto in C would mean an instant fail of the course and I'd be sent to the guillotine -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:21:29 JST Construction Worker @condret @kirby you're required to in many cases -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:19:58 JST Construction Worker @condret @kirby yeah the code literally won't compile if you don't we're required to use Wextra and whatnot -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:19:56 JST Construction Worker @condret @kirby Nah it makes me like C that it's so rigid and specific, the assignments piss me off so much though -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:13:32 JST Construction Worker @kirby to make you suffer -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:12:45 JST Construction Worker @kirby yeah bruh
I get a contiguous line of dynamically allocated pointers and can access it like an array. array[1], if array is type Type, is the same as *(*array + sizeof(Type)), IIRC. Mightve gotten my syntax slightly wrong. -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:10:07 JST Construction Worker @kirby what do you mean
You can't modify the array but you can modify what address it points to -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 07:02:16 JST Construction Worker @sun_eater @kirby it's a homestuck (Terezi) reference cc @vriska -
Embed this notice
Construction Worker (mercurialbuilding@cawfee.club)'s status on Tuesday, 07-Nov-2023 06:58:09 JST Construction Worker @kirby dumbass the right side is a void pointer you need to cast it to an int pointer
And the C version I'm using requires you to declare before assignment