2020-04-19から1日間の記事一覧

strlen for string literal

Environment Ubuntu 19.10 GCC 9.2.1 clang-9.0.0-2 Sample code #include <string.h> size_t string_const_size() { return strlen("hello world"); } Compile with gcc -O0 gcc -O0 -c strlen.c objdump -S strlen.o strlen.o: file format elf64-x86-64 Disassembly</string.h>…