From: Akira Yokosawa <akiyks@gmail.com>
To: Elad Lahav <e2lahav@gmail.com>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH v2] count: Switch from GCC to C11 thread-local storage
Date: Thu, 18 Aug 2022 00:18:09 +0900 [thread overview]
Message-ID: <0dfcdb91-12d7-86f7-4c8d-26a101bec7b5@gmail.com> (raw)
In-Reply-To: <20220817110049.182128-1-e2lahav@gmail.com>
Hi Elad,
On Wed, 17 Aug 2022 07:00:50 -0400, Elad Lahav wrote:
> Signed-off-by: Elad Lahav <e2lahav@gmail.com>
> ---
As there is no changelog here, let me ask a (maybe stupid) question.
What is your goal of diverting from GCC extensions and switching
to the C11 standard?
Do you want the codebase under CodeSamples/ to be strictly
conformant to C11 or later?
Runnig "make" under CodeSamples/count, with "-std=c11" appended
to GCC_ARGS, I get a lot of compile errors/warnings (with GCC 9.4.0
under Ubuntu 20.04), beginning with:
cc -g -O2 -Wall -std=c11 -o count_atomic count_atomic.c -lpthread
In file included from /usr/include/sched.h:34,
from /usr/include/pthread.h:22,
from ../api.h:159,
from count_atomic.c:22:
/usr/include/time.h:113:5: error: unknown type name 'locale_t'
113 | locale_t __loc) __THROW;
| ^~~~~~~~
A workaround is to append "-D_GNU_SOURCE" to GCC_ARGS. With that,
I get the next warning of:
../api.h:766:2: warning: implicit declaration of function 'typeof' [-Wimplicit-function-declaration]
766 | typeof(*ptr) _____actual = (o); \
Apparently, typeof() is another GCC extension. __typeof__() might
be used instead, but it is not ISO C.
So what is you goal of these switches?
Thanks, Akira
> CodeSamples/count/count_end.c | 12 ++++++------
> count/count.tex | 20 ++++++++++++--------
> 2 files changed, 18 insertions(+), 14 deletions(-)
>
[...]
next prev parent reply other threads:[~2022-08-17 15:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 11:00 [PATCH v2] count: Switch from GCC to C11 thread-local storage Elad Lahav
2022-08-17 15:18 ` Akira Yokosawa [this message]
2022-08-17 17:36 ` Elad Lahav
2022-08-19 2:02 ` Paul E. McKenney
2022-08-21 17:57 ` Elad Lahav
2022-08-21 22:59 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0dfcdb91-12d7-86f7-4c8d-26a101bec7b5@gmail.com \
--to=akiyks@gmail.com \
--cc=e2lahav@gmail.com \
--cc=paulmck@kernel.org \
--cc=perfbook@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.