Sanity check - making a static initializer constant
Ian Pilcher
arequipeno@gmail.com
Fri Oct 11 05:08:00 GMT 2013
On 10/10/2013 08:50 AM, Jonathan Wakely wrote:
> On 9 October 2013 20:10, Ian Pilcher wrote:
>> As far as I know, my options are:
>>
>> 1. Live with the current scheme.
>>
>> 2. Change "matches" in the function to an automatic variable.
>>
>> 3. Change the "regex" member of "struct regex" to a pointer and
>> create separate foo_regex, bar_regex, etc. objects. I could then
>> make the "regexes" array constant.
>>
>> Am I missing anything?
>
> 4. Use C++ instead of C, which allows those initializers.
>
> Probably not what you were looking for though.
>
Yeah, I'll pass. Full marks for creativity, though!
--
========================================================================
Ian Pilcher arequipeno@gmail.com
Sometimes there's nothing left to do but crash and burn...or die trying.
========================================================================
More information about the Gcc-help
mailing list