This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Sanity check - making a static initializer constant
- From: Ian Pilcher <arequipeno at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 11 Oct 2013 00:08:19 -0500
- Subject: Re: Sanity check - making a static initializer constant
- Authentication-results: sourceware.org; auth=none
- References: <5255AA2F dot 1020404 at gmail dot com> <CAH6eHdTkR2msC=uaQPv+-J20Yi1pA_NBPkOjtWv5fQvaNXzswA at mail dot gmail dot com>
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.
========================================================================