Specifying standard headers that don't require run time support

354 views
Skip to first unread message

Ian Collins

unread,
Jan 5, 2016, 2:20:10 PM1/5/16
to

Hello,

Has there ever been a move to formally identify standard library
headers that don't require run time (especially dynamic allocation)
support? An obvious example would be <array>.

The reason I ask is to make at least a subset of the standard library
available to smaller embedded projects.



--
Ian Collins


[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp...@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Martin Bonner

unread,
Jan 15, 2016, 2:10:08 PM1/15/16
to

On Tuesday, 5 January 2016 20:20:10 UTC+1, Ian Collins wrote:
> Hello,
>
> Has there ever been a move to formally identify standard library
> headers that don't require run time (especially dynamic allocation)
> support? An obvious example would be <array>.
>
> The reason I ask is to make at least a subset of the standard library
> available to smaller embedded projects.


I don't think so. It seems like a useful exercise if you want to start.

Expect arguments about whether "exceptions" require run-time support.

Expect arguments about whether it means "headers that are forbidden from
requiring run-time support" or "headers that could be implemented
without using run-time support".

Perhaps "header" is too coarse a granularity?

... but, I repeat, it still sounds like a broadly worthwhile exercise.



--

Bo Persson

unread,
Jan 15, 2016, 2:10:08 PM1/15/16
to

On 2016-01-05 20:16, Ian Collins wrote:
>
>
> Hello,
>
> Has there ever been a move to formally identify standard library
> headers that don't require run time (especially dynamic allocation)
> support? An obvious example would be <array>.
>
> The reason I ask is to make at least a subset of the standard library
> available to smaller embedded projects.
> 
>
>

No, I don't think so.

The standards committee is, in general, not very fond of defining
language subsets. They strongly prefer compilers to implement the
whole language.


Bo Persson



--

Francis Glassborow

unread,
Feb 8, 2016, 12:30:08 PM2/8/16
to

On 15/01/2016 19:07, Bo Persson wrote:
>
>
> On 2016-01-05 20:16, Ian Collins wrote:
>>
>>
>>
>> Hello,
>>
>> Has there ever been a move to formally identify standard library
>> headers that don't require run time (especially dynamic allocation)
>> support? An obvious example would be <array>.
>>
>> The reason I ask is to make at least a subset of the standard library
>> available to smaller embedded projects.
>> 
>>
>>
>
> No, I don't think so.
>
> The standards committee is, in general, not very fond of defining
> language subsets. They strongly prefer compilers to implement the
> whole language.
>
>
> Bo Persson
>
>
>
Yes, but I do not think this is about defining language subsets but is
more akin to the complexity guarantees. And on that line I would
prefer to see no run time support marked as a requirement where it can
be achieved.

Francis

Wouter van Ooijen

unread,
Feb 8, 2016, 12:30:09 PM2/8/16
to

Op 15-Jan-16 om 8:07 PM schreef Bo Persson:
>
>
> On 2016-01-05 20:16, Ian Collins wrote:
>>
>>
>>
>> Hello,
>>
>> Has there ever been a move to formally identify standard library
>> headers that don't require run time (especially dynamic allocation)
>> support? An obvious example would be <array>.
>>
>> The reason I ask is to make at least a subset of the standard library
>> available to smaller embedded projects.
>> 
>>
>>
>
> No, I don't think so.
>
> The standards committee is, in general, not very fond of defining
> language subsets. They strongly prefer compilers to implement the
> whole language.


The question wass not about a compiler implementing a subset, but
about library functions (or headers, as groups of functions) that do
not need a particular feature that is incompatible with a specialized
use, like heap and execptions (and maybe RTTO) not being compatible
with (very) small micro-controllers.

Wouter

Ian Collins

unread,
Feb 20, 2016, 4:20:09 PM2/20/16
to

Wouter van Ooijen wrote:
>
>
> Op 15-Jan-16 om 8:07 PM schreef Bo Persson:
>>
>>
>>
>> On 2016-01-05 20:16, Ian Collins wrote:
>>>
>>>
>>>
>>>
>>> Hello,
>>>
>>> Has there ever been a move to formally identify standard library
>>> headers that don't require run time (especially dynamic allocation)
>>> support? An obvious example would be <array>.
>>>
>>> The reason I ask is to make at least a subset of the standard library
>>> available to smaller embedded projects.
>>> 
>>>
>>>
>>
>> No, I don't think so.
>>
>> The standards committee is, in general, not very fond of defining
>> language subsets. They strongly prefer compilers to implement the
>> whole language.
>
>
> The question wass not about a compiler implementing a subset, but
> about library functions (or headers, as groups of functions) that do
> not need a particular feature that is incompatible with a specialized
> use, like heap and execptions (and maybe RTTO) not being compatible
> with (very) small micro-controllers.


Not necessarily small, my application was for 32 bit ARM.

A ban on dynamic memory is usage is common in embedded systems. This
is a big niche!


--
Ian Collins

Keith Thompson

unread,
Apr 1, 2016, 8:10:05 PM4/1/16
to

Ian Collins <ian-...@this.is.invalid> writes:
> Has there ever been a move to formally identify standard library
> headers that don't require run time (especially dynamic allocation)
> support? An obvious example would be <array>.
>
> The reason I ask is to make at least a subset of the standard library
> available to smaller embedded projects.

That sounds similar to the existing distinction between hosted and
freestanding implementations. C++11 17.6.1.3 [compliance] has a list of
the subset of the standard headers that must be supported for
freestanding implementations. Perhaps <array> (and others?) should be
added to that list.


--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Reply all
Reply to author
Forward
0 new messages