Re: C99 portability challenge
"Richard Heathfield" <rjh@see.sig.in validwrote in message
news:L86dnT2o1O kGxijVRVnyiwA@b t.com...
.....
Seems a 'well-defined subset of C99' is still a good idea.
Which subset this should be is hard to tell from your example: there are 4
implementations of each feature apart from P.
I would go with the easiest to implement and/or those which already exist
anyway. It might be there is already a subset implemented across many
compilers, for example //-comments and long-long-int. That would at least be
a start, and require little effort. Eg. the subset [P] in your example.
And for platforms for which there is only G, and there exists a good reason
to port your code to that platform, then the customers of that platform
should demand a [P]-compliant compiler. Otherwise why should G stifle the
development and progress of all the others?
--
Bartc
"Richard Heathfield" <rjh@see.sig.in validwrote in message
news:L86dnT2o1O kGxijVRVnyiwA@b t.com...
Bartc said:
>
>
>>
>"Richard Heathfield" <rjh@see.sig.in validwrote in message
>news:bfCdner22 9ub3ijVnZ2dnUVZ 8gidnZ2d@bt.com ...
>>
>>
>Suppose C99 offered 1000 extra features over C90.
>>
>How many of those 1000 features would have to be fully implemented for a
>valid C99 implementation? All of them?
>"Richard Heathfield" <rjh@see.sig.in validwrote in message
>news:bfCdner22 9ub3ijVnZ2dnUVZ 8gidnZ2d@bt.com ...
>>Nick Keighley said:
>>>wouldn't a well defined, moderatly portable subset of C99 be a useful
>>>thing to have?
>>>
>>Sure. We could call it "C90".
>>>thing to have?
>>>
>>Sure. We could call it "C90".
>Suppose C99 offered 1000 extra features over C90.
>>
>How many of those 1000 features would have to be fully implemented for a
>valid C99 implementation? All of them?
It depends on your goals. If you don't know in advance on which
implementations your program is expected to work, you can't be sure that
the subset of features you use is supported by all the implementations .
>
Never mind a thousand - let's try six. We'll call them P Q R S T U.
>
Implementation Features supported
A P Q S T U
B P Q R T
C P Q T U
D P R S U
E P Q R S U
F P R S T
G ? ? ? ? ? ?
implementations your program is expected to work, you can't be sure that
the subset of features you use is supported by all the implementations .
>
Never mind a thousand - let's try six. We'll call them P Q R S T U.
>
Implementation Features supported
A P Q S T U
B P Q R T
C P Q T U
D P R S U
E P Q R S U
F P R S T
G ? ? ? ? ? ?
Which subset this should be is hard to tell from your example: there are 4
implementations of each feature apart from P.
I would go with the easiest to implement and/or those which already exist
anyway. It might be there is already a subset implemented across many
compilers, for example //-comments and long-long-int. That would at least be
a start, and require little effort. Eg. the subset [P] in your example.
And for platforms for which there is only G, and there exists a good reason
to port your code to that platform, then the customers of that platform
should demand a [P]-compliant compiler. Otherwise why should G stifle the
development and progress of all the others?
--
Bartc
Comment