Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badly defined croak() in malloc.c (does not affect perl itself) #746

Closed
p5pRT opened this issue Oct 20, 1999 · 1 comment
Closed

Badly defined croak() in malloc.c (does not affect perl itself) #746

p5pRT opened this issue Oct 20, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Oct 20, 1999

Migrated from rt.perl.org#1670 (status was 'resolved')

Searchable as RT1670$

@p5pRT
Copy link
Author

p5pRT commented Oct 20, 1999

From sampo@mail.neuronio.pt

The croak macro is badly defined such that code like

  if (error)
  croak("%d", errno);

expands to

  if (error)
  warn("%d", errno);
  exit(1); /* This exit should not happen! */

--Sampo

diff -c malloc.c.orig malloc.c
*** malloc.c.orig Thu Oct 21 11​:46​:52 1999
--- malloc.c Thu Oct 21 11​:48​:21 1999
***************
*** 206,212 ****
  # define PerlIO_stderr() stderr
  # endif
  # ifndef croak /* make depend */
! # define croak(mess, arg) warn((mess), (arg)); exit(1);
  # endif
  # ifndef warn
  # define warn(mess, arg) fprintf(stderr, (mess), (arg));
--- 206,212 ----
  # define PerlIO_stderr() stderr
  # endif
  # ifndef croak /* make depend */
! # define croak(mess, arg) do{ warn((mess), (arg)); exit(1); }while(0)
  # endif
  # ifndef warn
  # define warn(mess, arg) fprintf(stderr, (mess), (arg));

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

No branches or pull requests

1 participant