C
1. C  c
properties
ID: 5479d877-2bd1-41d9-8409-1ff0436fcc59
// gcc -O0 -g hello.c
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("hello\n");
return 0;
}
1.1. Syntax
properties
ID: 0157d160-7eeb-4e01-ab69-43000e09cc3c
CREATED:
1.1.1. Statements
properties
ID: 9132ff22-4c85-4aed-ab5c-1bd777648927
CREATED:
A statement specifies computations to be done for effect; it does not produce a value, as an expression would. In general a statement ends with a semicolon (‘;’), but blocks (which are statements, more or less) are an exception to that rule.
- Duff's Device
properties
ID: f9a7443a-a362-4d47-b3d3-045fdd6c3c57
CREATED:
1.1.2. Preprocessor
properties
ID: 6c5a4df9-612c-4591-bfe9-7904cc03fb4c
CREATED:
- Macros
properties
ID: 93cddd0e-4189-4e78-a0e5-b3ceaf6b7d6e
CREATED:The C preprocessor is unhygienic (good) and fairly simple (at least compared to C)
1.1.3. Types
properties
ID: 3aa8b635-2c81-4992-8e65-fb2b0dee7b06
CREATED:
1.2. libc
properties
ID: d77ecb14-ecd4-4432-af2e-f431bf9ea18b
CREATED:
1.2.2. nostd
properties
ID: c7e3f469-f1c9-4b9f-a104-72ae91abab21
CREATED:
Information about compiling without libc.
- compile with
gcc -nostdlib -m64(64-bit)
// Tell the compiler incoming stack alignment is not RSP%16==8 or ESP%16==12
__attribute__((force_align_arg_pointer))
void _start() {
/* call main(), etc */
/* exit system call */
// 32-bit
// asm("movl $1,%eax;xorl %ebx,%ebx;int $0x80");
// 64-bit
asm("mov rax,60; mov rdi,0; syscall");
__builtin_unreachable(); // tell the compiler to make sure side effects are done before the asm statement
}
1.3. Articles
properties
ID: ffb7ba79-a805-43b3-b304-0575005e19e1
CREATED:
1.4. Libraries
properties
ID: b0ff5843-38de-4bd9-800a-728391dafc02
CREATED:
1.4.1. libjpeg-turbo
1.4.3. libarchive
properties
ID: 8abf5410-165d-43c5-a37b-fb9be29f227e
CREATED:
C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats.
2. CPP  cpp
properties
ID: be1c5802-61bd-4b32-9566-03cef321236e
2.1. Libraries
properties
ID: ad099ae1-d55f-49f4-99c7-de92ced85488
CREATED:
2.1.2. Adaptagrams  graph
properties
ID: d7c12344-b1ae-4bf2-a620-bc99f8e71e29
CREATED:
2.2. CUDA  nvidia gpu
properties
ID: a531e912-55ab-4889-806f-475c0316713e
CREATED:
3. Objective-C
properties
ID: 3021fa48-a98a-471f-896c-db237e97192b
CREATED: