On 08/07/2013 04:55 PM, [email protected] wrote:
> Hi!
>>> I'm trying to figure out how to fix it 'right' but it gets unnecessary
>>> complicated. I guess that we can fix this patch by casting the array in
>>> the lib before it gets to execvp().
>> I think that casting mod_name to (char *) is easier than casting array
>> before it gets to execvp(). And it doesn't require
>> any changes of tst_run_cmd interfaces (ie they accepts argv the same way
>> as execvp does)...
>>
>> Maybe leave everything as is and just cast mod_name to (char *)?
> That is easier for one testcase, but will require the cast in each
> testcase that will use the interface. From this point of view cast in
> the library is better. Not elegant solution though. :(
I google-ed the following:
http://pubs.opengroup.org/onlinepubs/009604499/functions/exec.html 
section RATIONALE

So as I understood from this document execvp expects 'char *const 
argv[]'  to prevent 'non-expert' users from
casting argv, envp from "char *[]" to "const char *[]".

Given this information and:
> But in the end any of the solutions will work...
I vote for a "standard" way i.e. casting array elements to (char *) 
before calling tst_run_cmd or execvp.

Of course, if here (in LTP community) is any voting system :)

Thank you.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to