public inbox for linux-sgx@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Tao Su <tao1.su@linux.intel.com>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org, kvm@vger.kernel.org,
	netdev@vger.kernel.org, linux-rtc@vger.kernel.org,
	linux-sgx@vger.kernel.org, edliaw@google.com,
	ivan.orlov0322@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, shuah@kernel.org, seanjc@google.com,
	pbonzini@redhat.com, bongsu.jeon@samsung.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, alexandre.belloni@bootlin.com,
	jarkko@kernel.org, dave.hansen@linux.intel.com
Subject: Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h
Date: Tue, 7 May 2024 10:06:51 -0700	[thread overview]
Message-ID: <20240507100651.8faca09c7af34de28f830f03@linux-foundation.org> (raw)
In-Reply-To: <20240507063534.4191447-1-tao1.su@linux.intel.com>

On Tue,  7 May 2024 14:35:34 +0800 Tao Su <tao1.su@linux.intel.com> wrote:

> asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h
> is so common that many files don’t define _GNU_SOURCE before including
> stdio.h, and defining _GNU_SOURCE after including stdio.h will no longer
> take effect.
> 
> Since kselftest_harness.h introduces asprintf(), it is necessary to add
> _GNU_SOURCE definition in all selftests including kselftest_harness.h,
> otherwise, there will be warnings or even errors during compilation.
> There are already many selftests that define _GNU_SOURCE or put the
> include of kselftest_harness.h at the very beginning of the .c file, just
> add the _GNU_SOURCE definition in the tests that have compilation warnings.

That asprintf() continues to cause problems.  How about we just remove
it? Do the malloc(snprintf(str, 0, ...)) separately?

  reply	other threads:[~2024-05-07 17:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  6:35 [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h Tao Su
2024-05-07 17:06 ` Andrew Morton [this message]
2024-05-08  2:55   ` Tao Su
2024-05-08 14:00     ` Jakub Kicinski
2024-05-08 17:57       ` Edward Liaw
2024-05-09  5:10         ` Tao Su
2024-05-09  5:08       ` Tao Su
2024-05-09 18:27         ` Jakub Kicinski

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=20240507100651.8faca09c7af34de28f830f03@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bongsu.jeon@samsung.com \
    --cc=broonie@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=edliaw@google.com \
    --cc=edumazet@google.com \
    --cc=ivan.orlov0322@gmail.com \
    --cc=jarkko@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=perex@perex.cz \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=tao1.su@linux.intel.com \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox