hns - 日記自動生成システム - Version 2.19.9

先月 2002年08月 来月
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2002年08月19日(月) 旧暦 [n年日記]

#1 [C] union 練習

以前に教えてもらったもの ( すれば出て来る ) が、そのままでは cc 出来なかったので、直して見て練習。
#include <stdio.h>

struct buf {
  int data;
};

union ubuffer {
        struct   buf   left;
        unsigned short right[sizeof(struct buf)/sizeof(short)];
};

bug(m)
     struct buf *m;
{
  int sum = 0;
  union ubuffer w;
  bzero(&w.left, sizeof w.left);
  w.left.data = m->data;
  
  sum += w.right[0];
  sum += w.right[1];
  
  printf("sum = 0x%x\n", sum);
  return 0;
}

main()
{
  struct buf m;

  m.data = 0x12345678;
  bug(&m);
}
ttyr7:makoto@u 7:55:42/020819(~/c)> cc -o union union.c
ttyr7:makoto@u 7:57:01/020819(~/c)> ./union
sum = 0x68ac
ttyr7:makoto@u 7:57:03/020819(~/c)> cc -O5 -o union union.c
ttyr7:makoto@u 7:57:51/020819(~/c)> ./union
sum = 0x68ac

#2 [NetBSD] adb_direct.c

の変更を port-powerpc-ja に書いたけれど、 toolchain/16678 に出ていた。
`-fgcse'
Perform a global common subexpression elimination pass. This pass also performs global constant and copy propagation.

#3 [NetBSD] macppc/snapshot/20020817ts

macppc-020817.tar.gz の形が少し変っていて、src で開ける。
/checkflist 
1220d1219
< ./usr/include/macppc/pmc.h
1558d1556
< ./usr/include/powerpc/atomic.h
1588d1585
< ./usr/include/powerpc/pmc.h
5766.844u 2026.927s 2:37:20.22 82.5%    0+0k 23751+424711io 9534pf+0w
上で言われたことだけ直して、 DESTDIR, RELEASEDIR, NETBSDSRCDIR を設定して
( cd 20020817/distrib/sets ; /export/current-ts/20020817/tools/obj/tools.NetBSD-1.6E-powerpc/bin/nbmake sets )
すると、もっと沢山言われてしまう。MACHINE=macppc MACHINE_ARCH=powerpc を設定すると、解決。
NetBSD quick 1.6F NetBSD 1.6F (GENERIC) #2: Mon Aug 19 10:00:57 JST 2002 root@quick:/export/current-ts/20020817/obj/sys/arch/macppc/compile/GENERIC macppc
という訳で、kernel は動いている。けふはこのやうなことをするはずではなかったが。

#4 [無題]

 sh -c /bin/csh -cf 'set nonomatch; glob [1-8]*.index*' 2>/dev/null (perl)/
これってどういう意味かなぁ。 (単に perl が shell 手続を起動しているだけらしい)



最近の日記
2024年05月05日
Windows 10 version
serial connection
bc bench
2024年05月04日
Trial on 10.99.10
another version (later trial) to succeed
2024年04月29日
dkim
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)