Re: [PATCH] Fix conversion warnings in cwrapper
On 2013-05-28 09:07, Peter Rosin wrote: > On 2013-05-27 21:21, Yaakov (Cygwin/X) wrote: >> On 2013-05-27 11:28, Peter Rosin wrote: >>> Ok, I took the liberty of writing a ChangeLog and removed the above >>> mentioned lines, as well as changing one unsigned int cast to a >>> size_t cast, when figured I should double-check your email-address >>> and realized that you had some previous "tiny changes" under your >>> belt. Now, these changes are also "tiny", but my understanding is >>> that you are not allowed more than 10 or so total line edits and >>> still get away with a "tiny change". You are getting dangerously >>> close to the limit, and should probably refrain from sending any >>> more patches w/o a copyright assignment in place. >> >> I have had an assignment on file with FSF since 2009. > > That fact has sadly not been recorded in the Libtool THANKS file. The > only thing I have found is this paragraph near the end of an old patch > submission [1] you co-authored with Chuck. > > FYI, Yaakov has submitted all the necessary copyright papers > and received acknowledgement from the FSF. > > Since I can't see the rush, I'll hold this a bit further in the hope > that this omission will be cleared up first. It has now been cleared up, and I have thus pushed the attached. Cheers, and thanks, Peter >From c37bc1a334661d58a35b4520ad0c98d5ccc23e7d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 17 Jun 2013 23:46:54 +0200 Subject: [PATCH] libtool: fix conversion warnings in cwrapper build-aux/ltmain.in (func_emit_cwrapperexe_src:main): XMALLOC wants a size_t. Also use int instead of intptr_t for the return value (which is fine since the _spawnv call is synchronous). (func_emit_cwrapper_src) [MSVC]: Remove the intptr_t helper define. (func_emit_cwrapperexe_src:find_executable): Use size_t for variables involved in strlen computations. (func_emit_cwrapperexe_src:lt_setenv): Likewise. (func_emit_cwrapperexe_src:lt_extend_str): Likewise. (func_emit_cwrapperexe_src:lt_update_exe_path): Likewise. THANKS: Update. Signed-off-by: Yaakov Selkowitz Signed-off-by: Peter Rosin --- THANKS |1 + build-aux/ltmain.in | 22 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/THANKS b/THANKS index 040c6d1..d6f9153 100644 --- a/THANKS +++ b/THANKS @@ -61,6 +61,7 @@ Peter Rosin p...@lysator.liu.se 2005-04-12 Tim Rice t...@multitalents.net 2005-11-10 Eric Blake e...@byu.net 2006-01-18 + Yaakov Selkowitz yselkow...@users.sourceforge.net 2009-07-30 * The following additional people made especially gracious contributions of diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4c56b98..2d7acdd 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -3637,10 +3637,6 @@ int setenv (const char *, const char *, int); # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif #elif defined __MINGW32__ # define setmode _setmode # define stat_stat @@ -3797,12 +3793,12 @@ main (int argc, char *argv[]) char *actual_cwrapper_name; char *target_name; char *lt_argv_zero; - intptr_t rval = 127; + int rval = 127; int i; program_name = (char *) xstrdup (base_name (argv[0])); - newargz = XMALLOC (char *, argc + 1); + newargz = XMALLOC (char *, (size_t) argc + 1); /* very simple arg parsing; don't want to rely on getopt * also, copy all non cwrapper options to newargz, except @@ -3964,7 +3960,7 @@ EOF cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); - rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ @@ -4068,7 +4064,7 @@ find_executable (const char *wrapper) const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; - int tmp_len; + size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", @@ -4119,7 +4115,7 @@ find_executable (const char *wrapper) for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; - p_len = q - p; + p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { @@ -4303,7 +4299,7 @@ lt_setenv (const char *name, const char *value) char *str = xstrdup (value); setenv (name, str, 1); #else -int len = strlen (name) + 1 + strlen (value) + 1; +size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) @@ -4320,8 +4316,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) char *new_value; if (orig_value && *orig_value) { - in
Re: [PATCH] Fix conversion warnings in cwrapper
On 2013-05-27 21:21, Yaakov (Cygwin/X) wrote: > On 2013-05-27 11:28, Peter Rosin wrote: >> Ok, I took the liberty of writing a ChangeLog and removed the above >> mentioned lines, as well as changing one unsigned int cast to a >> size_t cast, when figured I should double-check your email-address >> and realized that you had some previous "tiny changes" under your >> belt. Now, these changes are also "tiny", but my understanding is >> that you are not allowed more than 10 or so total line edits and >> still get away with a "tiny change". You are getting dangerously >> close to the limit, and should probably refrain from sending any >> more patches w/o a copyright assignment in place. > > I have had an assignment on file with FSF since 2009. That fact has sadly not been recorded in the Libtool THANKS file. The only thing I have found is this paragraph near the end of an old patch submission [1] you co-authored with Chuck. FYI, Yaakov has submitted all the necessary copyright papers and received acknowledgement from the FSF. Since I can't see the rush, I'll hold this a bit further in the hope that this omission will be cleared up first. Cheers, Peter [1] http://lists.gnu.org/archive/html/libtool-patches/2010-02/msg00019.html
Re: [PATCH] Fix conversion warnings in cwrapper
On 2013-05-27 11:28, Peter Rosin wrote: Ok, I took the liberty of writing a ChangeLog and removed the above mentioned lines, as well as changing one unsigned int cast to a size_t cast, when figured I should double-check your email-address and realized that you had some previous "tiny changes" under your belt. Now, these changes are also "tiny", but my understanding is that you are not allowed more than 10 or so total line edits and still get away with a "tiny change". You are getting dangerously close to the limit, and should probably refrain from sending any more patches w/o a copyright assignment in place. I have had an assignment on file with FSF since 2009. Yaakov
Re: [PATCH] Fix conversion warnings in cwrapper
Hi Yaakov, On 2013-05-21 08:53, Peter Rosin wrote: > I have no problem with this patch from a cursory look (haven't tested > it yet), but I will wait a couple of days with committing it to see > if Chuck (or someone else for that matter) has something to add. > Meanwhile, could we please have an update that also zap these lines > (inside a _MSC_VER #ifdef) as they are no longer needed? > > # ifndef _INTPTR_T_DEFINED > # define _INTPTR_T_DEFINED > # define intptr_t int > # endif Ok, I took the liberty of writing a ChangeLog and removed the above mentioned lines, as well as changing one unsigned int cast to a size_t cast, when figured I should double-check your email-address and realized that you had some previous "tiny changes" under your belt. Now, these changes are also "tiny", but my understanding is that you are not allowed more than 10 or so total line edits and still get away with a "tiny change". You are getting dangerously close to the limit, and should probably refrain from sending any more patches w/o a copyright assignment in place. Also, before I push this, I require a go-ahead from a maintainer. Cheers, Peter >From 44216d533edc4fd6649fce12314b7f719ef69fc3 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 27 May 2013 18:22:38 +0200 Subject: [PATCH] libtool: fix conversion warnings in cwrapper build-aux/ltmain.in (func_emit_cwrapperexe_src:main): XMALLOC wants a size_t. Also use int instead of intptr_t for the return value (which is fine since the _spawnv call is synchronous). (func_emit_cwrapper_src) [MSVC]: Remove the intptr_t helper define. (func_emit_cwrapperexe_src:find_executable): Use size_t for variables involved in strlen computations. (func_emit_cwrapperexe_src:lt_setenv): Likewise. (func_emit_cwrapperexe_src:lt_extend_str): Likewise. (func_emit_cwrapperexe_src:lt_update_exe_path): Likewise. Copyright-paperwork-exempt: Yes Signed-off-by: Yaakov Selkowitz Co-authored-by: Peter Rosin --- build-aux/ltmain.in | 22 +- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4c56b98..2d7acdd 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -3637,10 +3637,6 @@ int setenv (const char *, const char *, int); # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif #elif defined __MINGW32__ # define setmode _setmode # define stat_stat @@ -3797,12 +3793,12 @@ main (int argc, char *argv[]) char *actual_cwrapper_name; char *target_name; char *lt_argv_zero; - intptr_t rval = 127; + int rval = 127; int i; program_name = (char *) xstrdup (base_name (argv[0])); - newargz = XMALLOC (char *, argc + 1); + newargz = XMALLOC (char *, (size_t) argc + 1); /* very simple arg parsing; don't want to rely on getopt * also, copy all non cwrapper options to newargz, except @@ -3964,7 +3960,7 @@ EOF cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); - rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ @@ -4068,7 +4064,7 @@ find_executable (const char *wrapper) const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; - int tmp_len; + size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", @@ -4119,7 +4115,7 @@ find_executable (const char *wrapper) for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; - p_len = q - p; + p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { @@ -4303,7 +4299,7 @@ lt_setenv (const char *name, const char *value) char *str = xstrdup (value); setenv (name, str, 1); #else -int len = strlen (name) + 1 + strlen (value) + 1; +size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) @@ -4320,8 +4316,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) char *new_value; if (orig_value && *orig_value) { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { @@ -4352,7 +4348,7 @@ lt_update_exe_path (const char *name, const char *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); + size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARA
Re: [PATCH] Fix conversion warnings in cwrapper
On 2013-05-21 00:49, Yaakov (Cygwin/X) wrote: > From: Yaakov Selkowitz > > Signed-off-by: Yaakov Selkowitz > --- > build-aux/ltmain.in | 18 +- > 1 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in > index 4c56b98..3d1f5af 100644 > --- a/build-aux/ltmain.in > +++ b/build-aux/ltmain.in > @@ -3797,12 +3797,12 @@ main (int argc, char *argv[]) >char *actual_cwrapper_name; >char *target_name; >char *lt_argv_zero; > - intptr_t rval = 127; > + int rval = 127; *snip a bunch of type changes and casts* I have no problem with this patch from a cursory look (haven't tested it yet), but I will wait a couple of days with committing it to see if Chuck (or someone else for that matter) has something to add. Meanwhile, could we please have an update that also zap these lines (inside a _MSC_VER #ifdef) as they are no longer needed? # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif Cheers, Peter