public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* libgomp platform customization
@ 2019-01-30 14:46 Sebastian Huber
  2019-01-31  9:29 ` Richard Biener
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Huber @ 2019-01-30 14:46 UTC (permalink / raw)
  To: GCC

Hello,

we would like to use libgomp in a quite constraint environment. In this 
environment using for example the C locale support, errno, malloc(), 
realloc(), free(), and abort() are problematic. One option would be to 
introduce a new header file "config/*/platform.h" which is included in 
libgomp.h right after the #include "config.h". A platform could then do 
something like this:

#define malloc(size) platform_malloc(size)
...

In env.c there are some uses of strto*() like this:

   errno = 0;
   stride = strtol (env, &env, 10);
   if (errno)
     return false;

I would like to introduce a new header file "strto.h" which defines 
something like this:

static inline char *
gomp_strtol (char *s, long *value)
{
   char *end;

   errno = 0;
   *value = strtol (s, &end, 10);
   if (errno != 0)
     return NULL;

   return end;
}

Then use:

   env = gomp_strtol (env, &stride);
   if (env == NULL)
     return false;

A platform could then provide its own "config/*/strto.h" with an 
alternative implementation.

Would this be acceptable after the GCC 9 release?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-31 10:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 14:46 libgomp platform customization Sebastian Huber
2019-01-31  9:29 ` Richard Biener
2019-01-31  9:37   ` Sebastian Huber
2019-01-31  9:54     ` Richard Biener
2019-01-31  9:56     ` Jakub Jelinek
2019-01-31  9:58       ` Sebastian Huber
2019-01-31 10:08         ` Jakub Jelinek
2019-01-31 10:13           ` Sebastian Huber
2019-01-31 10:17             ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).