The loadables are built during install

2018-09-07 Thread Christian Weisgerber
There is an issue in the build framework of bash 4.4.23 (and 5.0-alpha):
"make all" does not build examples/loadables.
"make install" however recurses into examples/loadables and, since
the loadable modules aren't there, proceeds to build them before
installation.

Shouldn't the ".made" target have "loadables" as a prerequisite?

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



examples/loadables/finfo.c type problems

2018-09-07 Thread Christian Weisgerber
Compiling examples/loadables/finfo.c (bash 4.4.23, 5.0-alpha) on
OpenBSD produces various warnings about ill-matched types:

--->
finfo.c:325:20: warning: format specifies type 'long' but the argument has type 
'time_t' (aka 'long long') [-Wformat]
printf("%ld\n", st->st_atime);
~~~ ^~~~
%lld
finfo.c:330:20: warning: format specifies type 'long' but the argument has type 
'time_t' (aka 'long long') [-Wformat]
printf("%ld\n", st->st_mtime);
~~~ ^~~~
%lld
finfo.c:335:20: warning: format specifies type 'long' but the argument has type 
'time_t' (aka 'long long') [-Wformat]
printf("%ld\n", st->st_ctime);
~~~ ^~~~
%lld
finfo.c:339:18: warning: format specifies type 'int' but the argument has type 
'ino_t' (aka 'unsigned long long') [-Wformat]
printf("%d\n", st->st_ino);
~~ ^~
%llu
finfo.c:341:34: warning: format specifies type 'long' but the argument has type 
'ino_t' (aka 'unsigned long long') [-Wformat]
printf("%d:%ld\n", st->st_dev, st->st_ino);
   ~~~ ^~
   %llu
5 warnings generated.
<---

I was thinking about how to fix those, but then I noticed existing bad
casts in the code, e.g.,

printf("%ld\n", (long) st->st_size);

which potentially truncate values.

I don't know if the example loadables are considered to be more
than, well, rough examples, so I'm uncertain if this should even
be considered a problem.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de