[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chef_wrap run issue, VS2010

I think I see what's going on... the string "allocation" is supposed to be
accomplished by strdup(), in  __wrap_chef_cook() ... However, that function
is not getting invoked.  All the calls to chef_cook() are actually going to
chef_cook().  When I build the project, I get the following warning from
VS2010; I suspect this is MS's way of saying "whatever you are trying to
do, it isn't going to work..."

LINK : warning LNK4044: unrecognized option '/Wl,--wrap=chef_cook'; ignored

On Tue, Feb 23, 2016 at 1:40 PM, Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>

> I'm new to cmocka, and am trying to run the chef_wrap example.
> We use Visual Studio 2010 here.
> I used CMake to prepare the project, then (after several difficulties) got
> it to build, however I cannot get it to run successfully.
> The core issue appears to be that dish_out in chef_cook() is not valid; I
> modified it as such:
> int chef_cook(const char *order, char **dish_out)
> {
>     puts("in chef_cook");
>     if (order == NULL || dish_out == NULL) return EINVAL;
>     printf("order=%s\n", order);
>     if (strcmp(order, "hotdog") == 0)
>     {
>       printf("dish=%08X, pdish=%08X\n", (unsigned) dish_out, (unsigned)
> *dish_out) ;
>       sprintf(*dish_out, "hotdog");
>       return 0 ;
>     }
>     return -ENOSYS; //  -40
> }
> and when I run, I see:
> [==========] Running 2 test(s).
> [ RUN      ] test_order_hotdog
> in chef_cook
> order=hotdog
> dish=003FF964, pdish=CCCCCCCC
> Where is dish_out supposed to get created?  And why isn't that working?
> It appears to be getting allocated somewhere in cmocka.c, but haven't yet
> quite figured it out... and to be honest, I was hoping it would just work,
> since it's the core cmocka library module.
> Dan Miller

Re: chef_wrap run issue, VS2010"James Grenning" <james@xxxxxxxxxxxx>
chef_wrap run issue, VS2010Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>