Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2019 15:13:13 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        freebsd-hackers@freebsd.org
Subject:   Is libc C99 compliant?
Message-ID:  <20190130231313.GA27873@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help
Originally sent to freebsd-standards@ and freebsd-toolchain@,
but those list appear to be defunct.

Is libc C99 compliant?

-- 
steve

----- Forwarded message from Steve Kargl <sgk@troutmask.apl.washington.edu> -----

Date: Wed, 30 Jan 2019 13:29:04 -0800
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: freebsd-standards@freebsd.org, freebsd-toolchain@freebsd.org
Subject: Is libc C99 compliant?
User-Agent: Mutt/1.11.2 (2019-01-07)

When building gcc file gcc/config/freebsd.c contains

#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function

In targhook.c, one finds

/* By default we assume that c99 functions are present at the runtime,
   but sincos is not.  */
bool
default_libc_has_function (enum function_class fn_class)
{
  if (fn_class == function_c94
      || fn_class == function_c99_misc
      || fn_class == function_c99_math_complex)
    return true;

  return false;
}

bool
no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED)
{
  return false;
}

Shouldi/can TARGET_LIBC_HAS_FUNCTION be updated to at least
default_libc_has_function?  More importantly now that libm
contains sincos[fl], should FreeBSD gcc config file be updated
to use

bool
bsd_libc_has_function (enum function_class fn_class)
{
  if (fn_class == function_c94
      || fn_class == function_c99_misc
      || fn_class == function_c99_math_complex
      || fn_class == function_sincos)
    return true;

  return false;
}

-- 
Steve

----- End forwarded message -----

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190130231313.GA27873>