[klee-dev] Error when symbolic structure
Oscar Soria Dustmann
Oscar.SoriaDustmann at comsys.rwth-aachen.de
Wed Dec 10 12:23:02 GMT 2014
Hello Han,
if you remove the re-definition of `struct Data` from main, the variable
`test` will have the correct type and you can then pass it to
`get_sign`. Also, note that `klee_make_symbolic` expects a pointer, so
you have to pass `&test`, not `test`.
Hope that helps.
Oscar
On 10/12/14 00:12, HAN WANG wrote:
> Hi,
> When I’m trying to make structure a symbolic using a simple demo, it shows
> the following error
> code:
> struct Data{
> int a;
> int b;
> };
> int get_sign(struct Data ss)
> {
> struct Data{
> int a;
> int b;
> };
> if (ss.a==0)
> return 0;
> if (ss.a<0)
> return -1;
> else return 1;
> }
> int main(){
> struct Data{
> int a;
> int b;
> }test;
> test.a=1;
> klee_make_symbolic (test,sizeof(test), "test");
> return get_sign(test);
> }
> When I use command: llvm-gcc --emit-llvm -c -g get_sign.c, it shows that
> get_sign.c: In function ‘main’:
> get_sign.c:28: error: incompatible type for argument 1 of ‘get_sign’
> get_sign.c:28: error: expected declaration or statement at end of input.
> Could you help me with this?
>
>
>
>
> _______________________________________________
> klee-dev mailing list
> klee-dev at imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
>
More information about the klee-dev
mailing list