Blame lib/xalloc-die.c

Packit 8f70b4
/* Report a memory allocation failure and exit.
Packit 8f70b4
Packit 8f70b4
   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2018 Free Software
Packit 8f70b4
   Foundation, Inc.
Packit 8f70b4
Packit 8f70b4
   This program is free software: you can redistribute it and/or modify
Packit 8f70b4
   it under the terms of the GNU General Public License as published by
Packit 8f70b4
   the Free Software Foundation; either version 3 of the License, or
Packit 8f70b4
   (at your option) any later version.
Packit 8f70b4
Packit 8f70b4
   This program is distributed in the hope that it will be useful,
Packit 8f70b4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8f70b4
   GNU General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public License
Packit 8f70b4
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#include <config.h>
Packit 8f70b4
Packit 8f70b4
#include "xalloc.h"
Packit 8f70b4
Packit 8f70b4
#include <stdlib.h>
Packit 8f70b4
Packit 8f70b4
#include "error.h"
Packit 8f70b4
#include "exitfail.h"
Packit 8f70b4
Packit 8f70b4
#include "gettext.h"
Packit 8f70b4
#define _(msgid) gettext (msgid)
Packit 8f70b4
Packit 8f70b4
void
Packit 8f70b4
xalloc_die (void)
Packit 8f70b4
{
Packit 8f70b4
  error (exit_failure, 0, "%s", _("memory exhausted"));
Packit 8f70b4
Packit 8f70b4
  /* _Noreturn cannot be given to error, since it may return if
Packit 8f70b4
     its first argument is 0.  To help compilers understand the
Packit 8f70b4
     xalloc_die does not return, call abort.  Also, the abort is a
Packit 8f70b4
     safety feature if exit_failure is 0 (which shouldn't happen).  */
Packit 8f70b4
  abort ();
Packit 8f70b4
}