This is the mail archive of the mailing list for the systemtap project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/3093] Fails to build with GCC 4.2

------- Additional Comments From joshua dot i dot stone at intel dot com  2006-08-22 22:00 -------
Created an attachment (id=1238)
 --> (
Revised patch

(In reply to comment #1)
>    // override PATH and LC_ALL
> -  char* path = "PATH=/bin:/sbin:/usr/bin:/usr/sbin";
> -  char* lc_all = "LC_ALL=C";
> +  char path[] = "PATH=/bin:/sbin:/usr/bin:/usr/sbin";
> +  char lc_all[] = "LC_ALL=C";
>    rc = putenv (path) || putenv (lc_all);

This is problematic as well, because putenv expects the string in its parameter
to be persistent.  We luck out here since the local arrays are in main, so they
last "long enough", but it's still bad form.

I updated the patch to use setenv instead, which takes const char*, so it
should be more friendly to assigning string constants.	Please confirm that
this patch compiles cleanly on gcc 4.2, and I will commit it.

           What    |Removed                     |Added
Attachment #1233 is|0                           |1
           obsolete|                            |

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]