Skip to content

Elks sys fix warning#2621

Merged
ghaerr merged 3 commits intoghaerr:masterfrom
floriangit:elks_sys_fix_warning
Feb 15, 2026
Merged

Elks sys fix warning#2621
ghaerr merged 3 commits intoghaerr:masterfrom
floriangit:elks_sys_fix_warning

Conversation

@floriangit
Copy link
Copy Markdown
Contributor

Fixing a compile warning, which is at the very end of the build cycle and thus being very visible/annoying:

make[1]: Entering directory '/home/mf/src/elks/elksemu'
cp /home/mf/src/elks/cross/share/misc/elks/call_tab.v call_tab.v
cp /home/mf/src/elks/cross/share/misc/elks/defn_tab.v defn_tab.v
cc -O -DUSE_PTRACE=1 -c -o elks_sys.o elks_sys.c
elks_sys.c: In function ‘elks_open’:
elks_sys.c:154:9: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
154 | write(fd, efile, sizeof(efile));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -O -DUSE_PTRACE=1 -o elksemu elks.o elks_sys.o elks_signal.o elks_pid.o minix.o
make[1]: Leaving directory '/home/mf/src/elks/elksemu'

ghaerr#1638

was a mistake and actually throws an error:
# sudo ./slattach.sh
./slattach.sh: 6: [[: not found

This fixes it (on bash and ksh).
Fixing a compile warning at the very end of the build cycle and thus being very visible:

make[1]: Entering directory '/home/mf/src/elks/elksemu'
cp /home/mf/src/elks/cross/share/misc/elks/call_tab.v call_tab.v
cp /home/mf/src/elks/cross/share/misc/elks/defn_tab.v defn_tab.v
cc -O  -DUSE_PTRACE=1   -c -o elks_sys.o elks_sys.c
elks_sys.c: In function ‘elks_open’:
elks_sys.c:154:9: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  154 |         write(fd, efile, sizeof(efile));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -O  -DUSE_PTRACE=1 -o elksemu elks.o elks_sys.o elks_signal.o elks_pid.o minix.o
make[1]: Leaving directory '/home/mf/src/elks/elksemu'
@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented Feb 15, 2026

Hello @floriangit,

Thanks for the fixes. I'm on macOS and elksemu is only compiled for Linux so I never see this.

BTW, using (void)write(... will remove the warning without using a variable.

@ghaerr ghaerr merged commit 37a171f into ghaerr:master Feb 15, 2026
@floriangit
Copy link
Copy Markdown
Contributor Author

BTW, using (void)write(... will remove the warning without using a variable.

It's not with that compiler seemingly. It was my 1st attempt to solve it, too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants