On Mon, Jun 20, 2011 at 6:50 AM, Steve Bennett <ste...@workware.net.au> wrote:
> The default is -Werror, so warnings become errors
> and stop the build.
> Might be better to simply #define FT_STATUS instead.
>
> -               LOG_ERROR("FT_Write returned: %lu", status);
> +               LOG_ERROR("FT_Write returned: %lu", (unsigned long)status);

The type of status is ULONG, which is "unsigned long" on Windows but
is "unsigned int" on Linux in FTD2XX driver. So the problem is "%lu"
is not right for status on Linux. If we don't want cast, I think we
can do something like:

#ifdef __WINDOWS_TYPES__ /* if FTD2XX WinTypes.h is included */
#define PRulong "u"
#else
#define PRulong "lu"
#endif

               LOG_ERROR("FT_Write returned: %"PRulong, status);


Just my $0.02.

Jie
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to