Gerald Pfeifer gerald@pfeifer.com writes:
I sent basically this in February without any feedback, and it still applies.
It's still wrong, the parameter is used inside the #ifdef.
On Thu, 8 Sep 2011, Alexandre Julliard wrote:
It's still wrong, the parameter is used inside the #ifdef.
Fair enough! How about the patch below then? Tested with and without WANT_NEAR_INDICATION defined this time.
Or would you rather see a patch that remove WANT_NEAR_INDICATION altogether?
Gerald
diff --git a/libs/wpp/preproc.c b/libs/wpp/preproc.c index 99934d6..996c0f8 100644 --- a/libs/wpp/preproc.c +++ b/libs/wpp/preproc.c @@ -684,7 +684,11 @@ int pp_get_if_depth(void)
/* #define WANT_NEAR_INDICATION */
-static void generic_msg(const char *s, const char *t, const char *n, va_list ap) +static void generic_msg(const char *s, const char *t, +#ifdef WANT_NEAR_INDICATION + const char *n, +#endif + va_list ap) { fprintf(stderr, "%s:%d:%d: %s: ", pp_status.input ? pp_status.input : "stdin", pp_status.line_number, pp_status.char_number, t); @@ -709,13 +713,21 @@ end:
static void wpp_default_error(const char *file, int line, int col, const char *near, const char *msg, va_list ap) { +#ifdef WANT_NEAR_INDICATION generic_msg(msg, "Error", near, ap); +#else + generic_msg(msg, "Error", ap); +#endif exit(1); }
static void wpp_default_warning(const char *file, int line, int col, const char *near, const char *msg, va_list ap) { +#ifdef WANT_NEAR_INDICATION generic_msg(msg, "Warning", near, ap); +#else + generic_msg(msg, "Warning", ap); +#endif }
static const struct wpp_callbacks default_callbacks =
On 09/11/2011 04:58 AM, Gerald Pfeifer wrote:
On Thu, 8 Sep 2011, Alexandre Julliard wrote:
It's still wrong, the parameter is used inside the #ifdef.
Fair enough! How about the patch below then? Tested with and without WANT_NEAR_INDICATION defined this time.
This is patch is ugly. Just keeping the unused parameter warning is way better. Code needs to be optimized for the human reader not perverted to make a tool stfu.
bye michael
Or would you rather see a patch that remove WANT_NEAR_INDICATION altogether?
Gerald
diff --git a/libs/wpp/preproc.c b/libs/wpp/preproc.c index 99934d6..996c0f8 100644 --- a/libs/wpp/preproc.c +++ b/libs/wpp/preproc.c @@ -684,7 +684,11 @@ int pp_get_if_depth(void)
/* #define WANT_NEAR_INDICATION */
-static void generic_msg(const char *s, const char *t, const char *n, va_list ap) +static void generic_msg(const char *s, const char *t, +#ifdef WANT_NEAR_INDICATION
const char *n,
+#endif
va_list ap)
{ fprintf(stderr, "%s:%d:%d: %s: ", pp_status.input ? pp_status.input : "stdin", pp_status.line_number, pp_status.char_number, t); @@ -709,13 +713,21 @@ end:
static void wpp_default_error(const char *file, int line, int col, const char *near, const char *msg, va_list ap) { +#ifdef WANT_NEAR_INDICATION generic_msg(msg, "Error", near, ap); +#else
- generic_msg(msg, "Error", ap);
+#endif exit(1); }
static void wpp_default_warning(const char *file, int line, int col, const char *near, const char *msg, va_list ap) { +#ifdef WANT_NEAR_INDICATION generic_msg(msg, "Warning", near, ap); +#else
- generic_msg(msg, "Warning", ap);
+#endif }
static const struct wpp_callbacks default_callbacks =