Re: [PATCH] Improve conformance to ISO C90

2016-10-14 Thread Ivan Zhakov
On 14 October 2016 at 15:24, Patrick Steinhardt
 wrote:
> Hi,
>
> attached patch fixes compatibility with ISO C90. It fixes
> trailing commas in enum lists as well as one case where variadic
> macros are used, which are a feature of C99. What it does not fix
> is strings with overlength (C90 only allows for fixed strings
> with a maximum length of 509 characters).
>
> This allows us to build the code with `-Werror -pedantic
> -Wno-overlength-strings`.
>
> [[
> Improve C90 compatibility by removing trailing commas in enum
> lists as well as converting a variadic macro stub with an empty
> function.
>
> * subversion/include/svn_client.h:
>   (svn_client_config_option_id_t): remove trailing comma
> * subversion/include/svn_wc.h:
>   (svn_wc_notify_action_t): remove trailing comma
> * subversion/libsvn_subr/cache-membuffer.c:
>   (prefix_pool_create): remove trailing comma
> * subversion/svn/svn.c:
>   (svn_cl__longopt_t): remove trailing comma
> * subversion/svnmucc/svnmucc.c:
>   (sub_main): remove trailing comma
> * subversion/svnmover/linenoise/linenouse.c:
>   (lndebug): replace variadic macro stub with an empty variadic
>   function
> ]]
Committed in 1764919 with tweaked log message.

-- 
Ivan Zhakov


[PATCH] Improve conformance to ISO C90

2016-10-14 Thread Patrick Steinhardt
Hi,

attached patch fixes compatibility with ISO C90. It fixes
trailing commas in enum lists as well as one case where variadic
macros are used, which are a feature of C99. What it does not fix
is strings with overlength (C90 only allows for fixed strings
with a maximum length of 509 characters).

This allows us to build the code with `-Werror -pedantic
-Wno-overlength-strings`.

[[
Improve C90 compatibility by removing trailing commas in enum
lists as well as converting a variadic macro stub with an empty
function.

* subversion/include/svn_client.h:
  (svn_client_config_option_id_t): remove trailing comma
* subversion/include/svn_wc.h:
  (svn_wc_notify_action_t): remove trailing comma
* subversion/libsvn_subr/cache-membuffer.c:
  (prefix_pool_create): remove trailing comma
* subversion/svn/svn.c:
  (svn_cl__longopt_t): remove trailing comma
* subversion/svnmucc/svnmucc.c:
  (sub_main): remove trailing comma
* subversion/svnmover/linenoise/linenouse.c:
  (lndebug): replace variadic macro stub with an empty variadic
  function
]]
-- 
Patrick Steinhardt, Entwickler

elego Software Solutions GmbH, http://www.elego.de
Gebäude 12 (BIG), Gustav-Meyer-Allee 25, 13355 Berlin, Germany

Sitz der Gesellschaft: Berlin, USt-IdNr.: DE 163214194
Handelsregister: Amtsgericht Charlottenburg HRB 77719
Geschäftsführer: Olaf Wagner
diff --git a/subversion/include/svn_client.h b/subversion/include/svn_client.h
index f10f464..0e0163f 100644
--- a/subversion/include/svn_client.h
+++ b/subversion/include/svn_client.h
@@ -4427,7 +4427,7 @@ typedef enum svn_client_conflict_option_id_t {
   svn_client_conflict_option_incoming_move_dir_merge,
 
   /* Options for local move vs incoming edit on merge. */
-  svn_client_conflict_option_local_move_file_text_merge,
+  svn_client_conflict_option_local_move_file_text_merge
 } svn_client_conflict_option_id_t;
 
 /**
diff --git a/subversion/include/svn_wc.h b/subversion/include/svn_wc.h
index 3856857..4c6bbfb 100644
--- a/subversion/include/svn_wc.h
+++ b/subversion/include/svn_wc.h
@@ -1303,7 +1303,7 @@ typedef enum svn_wc_notify_action_t
 
   /** Done searching the repository for details about a conflict.
* @since New in 1.10. */
-  svn_wc_notify_end_search_tree_conflict_details,
+  svn_wc_notify_end_search_tree_conflict_details
 
 } svn_wc_notify_action_t;
 
diff --git a/subversion/libsvn_subr/cache-membuffer.c 
b/subversion/libsvn_subr/cache-membuffer.c
index ea48897..a586cfa 100644
--- a/subversion/libsvn_subr/cache-membuffer.c
+++ b/subversion/libsvn_subr/cache-membuffer.c
@@ -287,7 +287,7 @@ prefix_pool_create(prefix_pool_t **prefix_pool,
* substantially below this.  If we accidentally do, we will simply
* run out of entries in the VALUES array before running out of
* allocated memory. */
-  ESTIMATED_BYTES_PER_ENTRY = 120,
+  ESTIMATED_BYTES_PER_ENTRY = 120
 };
 
   /* Number of entries we are going to support. */
diff --git a/subversion/svn/svn.c b/subversion/svn/svn.c
index a9e5109..20ce1bd 100644
--- a/subversion/svn/svn.c
+++ b/subversion/svn/svn.c
@@ -143,7 +143,7 @@ typedef enum svn_cl__longopt_t {
   opt_show_passwords,
   opt_pin_externals,
   opt_show_item,
-  opt_adds_as_modification,
+  opt_adds_as_modification
 } svn_cl__longopt_t;
 
 
diff --git a/subversion/svnmucc/svnmucc.c b/subversion/svnmucc/svnmucc.c
index 5b5290d..66ca65b 100644
--- a/subversion/svnmucc/svnmucc.c
+++ b/subversion/svnmucc/svnmucc.c
@@ -480,7 +480,7 @@ sub_main(int *exit_code, int argc, const char *argv[], 
apr_pool_t *pool)
 non_interactive_opt,
 force_interactive_opt,
 trust_server_cert_opt,
-trust_server_cert_failures_opt,
+trust_server_cert_failures_opt
   };
   static const apr_getopt_option_t options[] = {
 {"message", 'm', 1, ""},
diff --git a/tools/dev/svnmover/linenoise/linenoise.c 
b/tools/dev/svnmover/linenoise/linenoise.c
index 29c07ee..058f68e 100644
--- a/tools/dev/svnmover/linenoise/linenoise.c
+++ b/tools/dev/svnmover/linenoise/linenoise.c
@@ -196,7 +196,7 @@ FILE *lndebug_fp = NULL;
 fflush(lndebug_fp); \
 } while (0)
 #else
-#define lndebug(fmt, ...)
+static void lndebug(const char *fmt, ...) { }
 #endif
 
 /* === Low level terminal handling == 
*/


signature.asc
Description: PGP signature