feat: C template #27
35
c/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
.POSIX:
|
||||||
|
.SUFFIXES: .o
|
||||||
|
|
||||||
|
CC ?= gcc
|
||||||
|
OUT := hello
|
||||||
|
|
||||||
|
SRC += main.c
|
||||||
|
OBJ := $(SRC:.c=.o)
|
||||||
|
|
||||||
|
CFLAGS += @compile_flags.txt
|
||||||
|
CFLAGS += -ffunction-sections -fdata-sections
|
||||||
|
|
||||||
|
LDFLAGS := -fwhole-program -flto
|
||||||
|
LDFLAGS += -Wl,--gc-sections -s
|
||||||
|
|
||||||
|
RM ?= rm -f
|
||||||
|
|
||||||
|
.DEFAULT_GOAL: all
|
||||||
|
.PHONY: all
|
||||||
|
all: $(OUT)
|
||||||
|
|
||||||
|
$(OUT): $(OBJ)
|
||||||
|
$(CC) -o $@ $<
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
|
.PHONY: fclean
|
||||||
|
fclean: clean
|
||||||
|
$(RM) -r $(OUT)
|
||||||
|
|
||||||
|
.PHONY: re
|
||||||
|
.NOTPARALLEL: re
|
||||||
|
re: fclean all
|
18
c/compile_flags.txt
Normal file
|
@ -0,0 +1,18 @@
|
||||||
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-std=c99
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-pedantic
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-pipe
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wall
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wcast-qual
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wconversion
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Werror=return-type
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Werror=vla-larger-than=0
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wextra
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wmissing-prototypes
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wshadow
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wstrict-prototypes
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-Wwrite-strings
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-O2
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-march=native
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
|||||||
|
-mtune=native
|
||||||
why assume this? ```suggestion
```
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary ```suggestion
```
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary
I think that C99 is a very good standard to based a template on I think that C99 is a very good standard to based a template on
most people also aren't using c99 anymore. i feel this is just your personal taste here > i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
most people also aren't using c99 anymore. i feel this is just your personal taste here
|
16
c/main.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
#include <stdlib.h>
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
#include <unistd.h>
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
#define lengthof(sstr) (sizeof (sstr) / sizeof *(sstr))
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
#define sstr_len(sstr) (lengthof(sstr) - 1)
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
#define sstr_unpack(sstr) (sstr), (sstr_len(sstr))
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
static const char GREETING[] = "hello, world!\n";
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
int main(void)
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
{
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
return (
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
write(STDOUT_FILENO, sstr_unpack(GREETING))
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
== sstr_len(GREETING)
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
|||||||
|
}
|
||||||
we really don't need to overcomplicate this ```suggestion
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello from Aux!\n");
return 0;
}
```
we really don't need to overcomplicate this
`write` is lighter than `printf`. I think it is better to use it, and i am not sure by what means it is overcomplicated?
I agree with getchoo. I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled. I agree with getchoo.
I think defining macros when it's arguably not needed is overcomplicating it. Also, I think we really don't care about the performance of printf vs write here. Getchoo's suggestion is the canonical hello world C program, it doesn't bring in any header other than stdlib, it doesn't define any item besides main (which you probably need), and it's recognizable so people know they should scrap it anyway.
I feel like the template should focus on nix code, and completely disregard C code (unless it demonstrates something on the nix side). I'd even be fine with an empty source file if that compiled.
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this > write is lighter than printf
>> i feel this is once again putting a lot of focus on what is really just throwaway example code. i would really take a look at https://github.com/NixOS/templates/tree/master/c-hello as a reference
> and i am not sure by what means it is overcomplicated?
i don't think we're really going to get anywhere with this question being asked, so i would rather not continue with this
i genuinely don't get it, but i changed the implementation to use a regular i genuinely don't get it, but i changed the implementation to use a regular `printf`
|
why assume this?
there's no reason to use these by default. it will only be confusing if anyone shares a locally built binary