Skip to content

Instantly share code, notes, and snippets.

View omasanori's full-sized avatar

Masanori Ogino omasanori

View GitHub Profile
\documentclass[unicode]{beamer}
\usepackage[no-math,ipaex]{luatexja-preset}
\renewcommand{\kanjifamilydefault}{\gtdefault}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\begin{document}
src/api/fcntl.c: In function 'f':
src/api/fcntl.c:30:3: error: 'O_TTY_INIT' undeclared (first use in this function)
C(O_TTY_INIT)
^
src/api/fcntl.c:5:21: note: in definition of macro 'C'
#define C(n) switch(n){case n:;}
^
src/api/fcntl.c:30:3: note: each undeclared identifier is reported only once for each function it appears in
C(O_TTY_INIT)
^
@omasanori
omasanori / rust-day-3.rst
Last active April 12, 2016 16:34
5分で分かったふりができるRust紹介

5分で分かったふりができるRust紹介

作成者にもかかわらず、いきなり遅刻しました。ごめんなさい。Rust Advent Calendar 2013、今からでも参加できますのでぜひ。

今日はRustの特徴を簡潔に紹介します。

システムプログラミング & 低レイヤ

@omasanori
omasanori / predef.sh
Last active March 31, 2016 11:59
An utility to check the name of predefined preprocessor macros and their values.
echo | gcc -E -xc -dM - | sort | uniq
$ gcc --version | head -n1
gcc (Gentoo 4.9.3 p1.2, pie-0.6.3) 4.9.3
$ gcc -dumpmachine
x86_64-pc-linux-gnu
$ clang --version | head -n1
clang version 3.7.1 (tags/RELEASE_371/final)
$ clang -dumpmachine
x86_64-pc-linux-gnu
$ cat > test.c
#include <stdio.h>
@omasanori
omasanori / x86_64-gentoo-linux-musl.log
Last active March 9, 2016 00:41
An experiment for the size of hello world.
$ gcc --version | head -n1
gcc (Gentoo Hardened 4.9.3-r99 p1.2, pie-0.6.3) 4.9.3
$ gcc -dumpmachine
x86_64-gentoo-linux-musl
$ cat hello.c
#include <stdio.h>
int main(void)
{
puts("hello, world");
return 0;
@omasanori
omasanori / main.rs
Created January 19, 2014 09:03
A study of Runtimeless Rust
// To compile:
// $ rustc --target <target environment> --lib -c -o main.o main.rs
#[no_std];
#[no_mangle]
pub fn main() {
}
@omasanori
omasanori / make.log
Created January 5, 2014 07:57
build log of picrin with -pedantic
cd src; \
yacc -d parse.y; \
flex scan.l
gcc -Wall -pedantic -DDEBUG=0 -O3 -shared -fPIC src/*.c -o lib/libpicrin.so -I./include -I./extlib -lm
src/codegen.c: 関数 ‘print_irep’ 内:
src/codegen.c:1055:3: 警告: 書式 ‘%p’ は引数の型が ‘void *’ であると予期されますが、第 2 引数の型は ‘struct pic_irep *’ です [-Wformat]
src/codegen.c:1056:3: 警告: ISO C90 は ‘z’ gnu_printf 長さ修飾子をサポートしません [-Wformat]
src/codegen.c:1056:3: 警告: ISO C90 は ‘z’ gnu_printf 長さ修飾子をサポートしません [-Wformat]
In file included from src/file.c:4:0:
./include/picrin/port.h:15:17: 警告: 列挙型リストの最後にコンマがあります [-pedantic]
@omasanori
omasanori / gist:8123504
Created December 25, 2013 14:12
Teach Myself Lojban Advent Calendar 2013 の反省

Teach Myself Lojban Advent Calendar 2013 の反省

  • 計画性がなかった
  • 普段からブログに文章を書く習慣がなかったのでかきあぐねていた
  • 数行でも書いて上げればよかったのにそうしなかった
  • いっそのこと1日1ツイートでもよかったのにそうしなかった
  • 12月中旬まではかろうじてインプットは続けていたが、ここ数日はそれも滞っている
  • 無謀だった
@omasanori
omasanori / gist:8083427
Last active January 1, 2016 03:09
無検査演算とマイクロベンチマークの話