hth313 / Calypsi-tool-chains

Overview of the Calypsi tool chain and open source support packages
16 stars 0 forks source link

Bug: Erroneous minus operator in libc streamlist.c #20

Closed KyleCardoza closed 1 year ago

KyleCardoza commented 1 year ago

Lines 40 through 50 of streamlist.c:

  _stderr.fs_fd = 2;
  _stderr.fs_oflags = O_WRONLY;

  __global_streams.sl_std[0] = &_stdin;
  __global_streams.sl_std[1] = &_stdout;
  __global_streams.sl_std[2] - &_stderr;

  // Register for having any open stream closed by _Exit() termination
  _ExitCloseStreams = closeAllStreams;
}

Note the third assignment is erroneously a (null effect) subtract operation, when it is clearly meant to be an assignment.

hth313 commented 1 year ago

Ouch, fixed for the next release 4.4. I released 4.3 today and this sadly came just afterwards.

KyleCardoza commented 1 year ago

I had meant to report it a few days ago and it got away from me. Apologies. I only found it because I build with -Wall -Wextra -Wpedantic -Werror by default, disabling specific warnings as needed.