Displaying 2 results from an estimated 2 matches for "printf_impure_call".
2017 Apr 08
2
Splitting C/C++ code into pure and side-effecting code
...re copied
// and don't share the same stack as pure code
return c;
}
int main(int argc, char* argvp[]){
a = 1;
b = 2;.
c = add(a,b)
printf("%d + %d = %d", a, b); // okay to call impure from impure
}
The call to printf in pure code should create a stub function call
printf_impure_call(), which in the impure library just calls printf.
I know very little about compilers (mathematician by training), but I will
really appreciate if someone can comment about the feasibility of this.
Thanks
Suman
PS: I'm not subscribed to LLVM mailing list so please reply-all.
-------------- ne...
2017 Apr 09
2
Splitting C/C++ code into pure and side-effecting code
...int main(int argc, char* argvp[]){
>> a = 1;
>> b = 2;.
>> c = add(a,b)
>> printf("%d + %d = %d", a, b); // okay to call impure from impure
>> }
>>
>>
>> The call to printf in pure code should create a stub function call
>> printf_impure_call(), which in the impure library just calls printf.
>>
>> I know very little about compilers (mathematician by training), but I
>> will really appreciate if someone can comment about the feasibility of this.
>>
>> Thanks
>> Suman
>>
>> PS: I'm not s...