From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/10] Add some standard headers external code might need
Date: Tue, 28 Oct 2014 18:46:23 +0100 [thread overview]
Message-ID: <544FD66F.90204@myspectrum.nl> (raw)
In-Reply-To: <CAPnjgZ1TNgJs=taJMK=JUzCYtno01Uf1p59AM47m1LARA+eaOA@mail.gmail.com>
Hello Simon,
On 28-10-14 18:33, Simon Glass wrote:
> Hi Masahiro,
>
> On 28 October 2014 10:38, Masahiro YAMADA <yamada.m@jp.panasonic.com> wrote:
>> Hi Simon,
>>
>>
>> 2014-10-29 1:29 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>> Hi Masahiro,
>>>
>>> On 28 October 2014 10:25, Masahiro YAMADA <yamada.m@jp.panasonic.com> wrote:
>>>> Hi Gabe, Simon,
>>>>
>>>>
>>>> 2014-10-15 19:38 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>>>> From: Gabe Black <gabeblack@chromium.org>
>>>>>
>>>>> inttypes.h defines format specifiers for printf which work with data types of
>>>>> particular sizes. stdlib.h is currently just a passthrough to malloc.h which
>>>>> has declarations of the various *alloc functions.
>>>>>
>>>>> Add the required #define to common.h so that these printf format specifiers
>>>>> will be made available.
>>>>>
>>>>> Signed-off-by: Gabe Black <gabeblack@google.com>
>>>>> Reviewed-by: Gabe Black <gabeblack@chromium.org>
>>>>> Tested-by: Gabe Black <gabeblack@chromium.org>
>>>>> Reviewed-by: Bill Richardson <wfrichar@google.com>
>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>> (Replaced with a GPL version from glibc)
>>>>>
>>>> [snip]
>>>>> diff --git a/include/stdlib.h b/include/stdlib.h
>>>>> new file mode 100644
>>>>> index 0000000..6bc7fbb
>>>>> --- /dev/null
>>>>> +++ b/include/stdlib.h
>>>>> @@ -0,0 +1,12 @@
>>>>> +/*
>>>>> + * Copyright (C) 2013 Google Inc.
>>>>> + *
>>>>> + * SPDX-License-Identifier: GPL-2.0+
>>>>> + */
>>>>> +
>>>>> +#ifndef __STDLIB_H_
>>>>> +#define __STDLIB_H_
>>>>> +
>>>>> +#include <malloc.h>
>>>>> +
>>>>> +#endif /* __STDLIB_H_ */
>>>>> --
>>>>> 2.1.0.rc2.206.gedb03e5
>>>>
>>>> This patch is not clear to me.
>>>>
>>>> Why do we need include/stdlib.h ?
>>> This makes the U-Boot environment more similar to that used by other
>>> software, so we can more easily build it without lots of glue files.
>>> Normally stdlib.h defines malloc() and friends.
>> I am not happy about this.
>>
>> Our right direction is to make U-Boot environment more similar to the
>> Kernel, I think.
>>
>> stdlib.h shouldn't appear in bare metal code.
> That's right, we don't want to include this in U-Boot itself. But if
> you look at things in tools/ they include stdlib.h. With this header
> available, we can more easily compile external code into U-Boot.
So is it intended as fallback if the host doesn't have a stdlib.h?
Regards,
Jeroen
next prev parent reply other threads:[~2014-10-28 17:46 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-15 10:38 [U-Boot] [PATCH 0/10] Provide inttypes.h to avoid 32/64 bit problems with printf() Simon Glass
2014-10-15 10:38 ` [U-Boot] [PATCH 01/10] Provide option to avoid defining a custom version of uintptr_t Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 02/10] Add some standard headers external code might need Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-28 16:25 ` [U-Boot] [PATCH " Masahiro YAMADA
2014-10-28 16:29 ` Simon Glass
2014-10-28 16:38 ` Masahiro YAMADA
2014-10-28 17:33 ` Simon Glass
2014-10-28 17:46 ` Jeroen Hofstee [this message]
2014-10-28 18:24 ` Simon Glass
2014-10-29 14:06 ` Masahiro YAMADA
2014-10-30 1:43 ` Simon Glass
2014-10-30 7:53 ` Masahiro Yamada
2014-10-31 2:43 ` Simon Glass
2014-10-15 10:38 ` [U-Boot] [PATCH 03/10] ext4: Use inttypes for printf() string Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot,03/10] " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 04/10] Use uint64_t for time types Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot,04/10] " Tom Rini
2014-12-15 16:55 ` [U-Boot] [PATCH 04/10] " Masahiro YAMADA
2014-12-15 18:38 ` Simon Glass
2014-12-16 1:38 ` Masahiro YAMADA
2014-12-17 4:38 ` Simon Glass
2014-12-22 10:22 ` Masahiro Yamada
2014-10-15 10:38 ` [U-Boot] [PATCH 05/10] Use uint64_t instead of u64 in put_dec() Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 06/10] Tidy up data sizes and function comment in display_options Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 07/10] x86: Use correct printf() format string for uintptr_t Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 08/10] scsi: " Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-12-15 18:32 ` [U-Boot] [PATCH " Masahiro YAMADA
2014-10-15 10:38 ` [U-Boot] [PATCH 09/10] usb: " Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-15 10:38 ` [U-Boot] [PATCH 10/10] test: Add a simple test to detected warnings with uint64_t, uintptr_t Simon Glass
2014-10-27 22:20 ` [U-Boot] [U-Boot, " Tom Rini
2014-10-24 1:03 ` [U-Boot] [PATCH 0/10] Provide inttypes.h to avoid 32/64 bit problems with printf() Simon Glass
2014-10-24 7:19 ` Jeroen Hofstee
2014-10-24 17:06 ` Jeroen Hofstee
2014-10-24 17:18 ` Simon Glass
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=544FD66F.90204@myspectrum.nl \
--to=jeroen@myspectrum.nl \
--cc=u-boot@lists.denx.de \
/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