ときどきの雑記帖 RE* (新南口)
Life with UNIX
終末トレインどこへいく?
エンディングの曲が結構気に入ったのだけど
MUSIC -オリジナルTVアニメーション『終末トレインどこへいく?』公式サイト-
まだ発売まで時間がありそうだねえ…
新刊近刊
SFマンガで倫理学 ―何が善くて何が悪いのか
SFマンガで倫理学 ―何が善くて何が悪いのか | 萬屋博喜 |本 | 通販 | Amazon
ちょっと気になるタイトル
プログラミング言語AWK 第2版
ひょっとして今日あたりにはもうどこかで早売りがあったかもしれないけど
プログラミング言語AWK 第2版 | Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger, 千住 治郎 |本 | 通販 | Amazon
ところでこっちの本の翻訳はどうなってんですかね
UNIX: A History and a Memoir | Kernighan, Brian W | History
今日の重箱の隅
GCC 14
C++26への準拠を図るgcc 14.1リリース | TECH+(テックプラス)
GNUプロジェクトは現地時間2024年5月7日、gcc 14.1のリリースをメーリングリストで報告した。 ソースコードはsourceware.orgやGNUが用意したミラーサイトからダウンロードできる。
どうも読んでいて ?となる記述がちらほら。
2026年に改定さる予定のC++26に準拠するため、1990年公開のANSI C標準と比べてワーニングから記述要素をエラーと見なすようにした。
また、IA-32、x86-64、AArch64環境ではC++23におけるビット単位整数型の_BitIntをサポートしている。具体的な差異はドキュメントで確認可能だ。
本バージョンではC++26機能と欠落していたC++23に関する不具合を修正し、C++テンプレートのインスタンス化時にソースの引用を可能にしている。
「記述要素をエラーとみなす」や「テンプレートのインスタンス化時にソースを引用」 ってどういうこと? とか、 _BitIntは「ビット単位整数型」ということで良かったのだっけ(定訳ありか?)? とか C++23じゃなくてC23じゃなかったけ?などなど
で、ry(
Porting to GCC 14 - GNU Project
The initial ISO C standard and its 1999 revision removed support for many C language features that were widely known as sources of application bugs due to accidental misuse. For backwards compatibility, GCC 13 and earlier diagnosed use of these features as warnings only. Although these warnings have been enabled by default for many releases, experience shows that these warnings are easily ignored, resulting in difficult to diagnose bugs. In GCC 14, these issues are now reported as errors, and no output file is created, providing clearer feedback to programmers that something is wrong.
従来警告だったものをエラーにするようにしたというのがあって、続いていろいろ書かれている
- Implicit int types (-Werror=implicit-int)
- Implicit function declarations (-Werror=implicit-function-declaration)
- Typos in function prototypes (-Werror=declaration-missing-parameter-type)
- Incorrect uses of the return statement (-Werror=return-mismatch)
- Using pointers as integers and vice versa (-Werror=int-conversion)
- Type checking on pointer types (-Werror=incompatible-pointer-types)
↑これらをまとめて「記述要素」としたんだろうか
GCC 14 Release Series — Changes, New Features, and Fixes - GNU Project
Bit-precise integer types (_BitInt (N) and unsigned _BitInt (N)): integer types with a specified number of bits. These are only supported on IA-32, x86-64 and AArch64 (little-endian) at present.
これ(_BitInt (N) and unsigned _BitInt (N))、C++23にはないよねえ
When a diagnostic occurrs involving a C++ template, GCC will now quote the source code of the context at which the template is instantiated (“required from here”), rather than just print filename and line/column numbers.
「quote the source code of the context (at which the template is instantiated)」は 単純に「ソースの引用」とはちょっと違うんじゃなかろうか
- GCC 14.1 | Hacker News
- GCC 14 Release Series - GNU Project
- C++23 の新機能 - C++ の歩き方 | cppmap
- C++23 - cpprefjp C++日本語リファレンス
- 最新C++(C++23)からみた最新C(C23) #C++ - Qiita
- C++23 - Wikipedia
この記事にはないけど、今回の変更点の一つで気になったもの
GCC 14 Release Series - Changes, New Features, and Fixes - GNU Project
Support for the GCC extension, a structure containing a C99 flexible array member, or a union containing such a structure, is not the last field of another structure, is deprecated.
from stdin
Opening Windows in Linux with sockets, bare hands and 200 lines of C | Hacker News に出てきた
In fact, two definitions and a couple trivial syntax fixes are enough to get Chez Scheme to evaluate it without warnings:
$ awk -f - vmx.ss <<EOF | scheme -q BEGIN { print "(define / fxdiv)" print "(define (log . args) (for-each display args))" } { gsub(/\(\)/, "'()") gsub(/ 0x/, " #x") print } EOF $
awkとschemeの両方にそのソースコードを標準入力から渡しているのが ちょっと面白かった。
まあawkの方はふつーに書いてもいいんじゃないかと思うけど (bashなどなら複数行のスクリプトを単純にクォートするだけで渡せるはず)。
ed
突然、GNU edの編集対象のテキストの管理方法が気になったので ソースコードを眺めてみた。 行ごとにテキストを保持してそれぞれを linked listにしているんだろうか と思いつつヘッダーを見ると
ed/ed.h at master · Distrotech/ed · GitHub
typedef struct line /* Line node */
{
struct line * q_forw;
struct line * q_back;
long pos; /* position of text in scratch buffer */
int len; /* length of line */
}
line_t;
なにこれ。
じゃあv7ではどうだったんだ? と v7unix/v7/usr/src/cmd/ed.c at master · v7unix/v7unix を見たが こっちはこっちでよくわからん😓
色々ダメ(本年n回目)