duplicate a variable!!!!

David Brown david@westcontrol.com
Fri Apr 1 11:14:00 GMT 2011


On 31/03/2011 16:57, Ian Lance Taylor wrote:
> Greicy.Costa-Marques@imag.fr writes:
>
>>> One important question
>>> is going to be how you know which variable you want to duplicate.
>>
>> yes, i know which variables i want to duplicate.
>>
>>> Presumably you don't want to duplicate all variables.
>>
>> no, i want to duplicate all variables in my code.
>>
>>> Another important question is what you want to do with the
>>> duplicated variable.
>>
>> Because I want to harden  my code.  I'm working with fault injection
>> by software and I want to harden my code, and a way of hardening is
>> the duplication of variables. And as I still do not know how, I chose
>> to start trying for a single variable and after to use the same path
>> for all variables in my code.
>
> It's a lot easier to duplicate all variables than it is to duplicate a
> single variable.
>
> I do not know what duplicating variables has to do with hardening code.
>

That would be my question too.  I know a little (but not much) about 
hardening code, and I am aware of some of the issues if there can be 
unexpected outside influences on your program (such as radiation or 
hardware issues causing changes to memory locations).  I can't see any 
way in which some sort of general duplication of variables would help.

I think it would be a better idea for the OP to think through what he is 
trying to achieve, and ask questions based on that.  Maybe there are 
other ways to get the hardening he wants.




More information about the Gcc-help mailing list