[cdesktopenv-devel] Open Motif 2.3.3 on Fedora 17 amd64
Hi list, Does anyone have pre-compiled RPMs of Open Motif 2.3.3 for 64 bit Fedora 17? I've tried compiling from source, but it bombs out trying to link one of the UIL tools (an undefined reference to main in wmluiltok.o). I'm assuming that most people are building CDE against that version of Open Motif. Regards, Chris -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
[cdesktopenv-devel] Patches to some of the config tools
Hi folks, I enabled a bunch of warning flags in the Imake.tmpl file, including -Wall and -Werror. This failed to bootstrap the build, since there were errors in the config tools. Attached is a patch that makes imake and several of the utility tools build with the following flags: -Wall -Werror -Wno-overlength-strings- -ansi -pedantic The overlength strings warning need to be disabled as there's a long string in imake.c If anyone see any value in it, I am happy to continue cleaning up imake and the other build tools. If so, then I wonder if it's worth setting a baseline that the systems the code is intended for should provide. For example, ANSI C, a certain level of POSIX compatibility and so on. If so, then I could clean up a lot of K&R style declarations and ifdef'ed code that copes with systems without varargs support. Chris config.patch.gz Description: GNU Zip compressed data -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
[cdesktopenv-devel] ANSIfication of imake
Hi folks, I've taken into account peoples comments with regard to patch format and not including changes that are just reformatting. The attached patch is solely for imake, adding function prototypes where they are missing, limiting linkage to static scope wherever possible and removing a bunch of GCC warnings. Regards, Chris From 98aa271d1d5101d059faca75f91b114dd0143af9 Mon Sep 17 00:00:00 2001 From: Chris Wareham Date: Fri, 10 Aug 2012 14:48:56 +0100 Subject: [PATCH] Convert function prototypes and signatures to ANSI format. --- cde/config/imake/imake.c | 405 --- 1 file changed, 204 insertions(+), 201 deletions(-) diff --git a/cde/config/imake/imake.c b/cde/config/imake/imake.c index 235d791..77df800 100644 --- a/cde/config/imake/imake.c +++ b/cde/config/imake/imake.c @@ -256,6 +256,7 @@ extern int errno; * are there any X_NOT_STDC_ENV machines left in the world? */ #include +#include #include "imakemdep.h" /* @@ -275,14 +276,14 @@ extern int sys_nerr; #define FALSE 0 #ifdef FIXUP_CPP_WHITESPACE -int InRule = FALSE; +static int InRule = FALSE; # ifdef INLINE_SYNTAX -int InInline = 0; +static int InInline = 0; # endif #endif #ifdef MAGIC_MAKE_VARS -int xvariable = 0; -int xvariables[10]; +static int xvariable = 0; +static int xvariables[10]; #endif /* @@ -291,7 +292,8 @@ int xvariables[10]; * space instead of being deleted. Blech. */ #ifdef FIXUP_CPP_WHITESPACE -void KludgeOutputLine(), KludgeResetRule(); +static void KludgeOutputLine(char **pline); +static void KludgeResetRule(void); #else # define KludgeOutputLine(arg) # define KludgeResetRule() @@ -313,11 +315,11 @@ typedef unsigned char boolean; # endif #endif -char *cpp = NULL; +static char *cpp = NULL; -char *tmpMakefile= "/tmp/Imf.XX"; -char *tmpImakefile= "/tmp/IIf.XX"; -char *make_argv[ ARGUMENTS ] = { +static char *tmpMakefile = "/tmp/Imf.XX"; +static char *tmpImakefile= "/tmp/IIf.XX"; +static char *make_argv[ ARGUMENTS ] = { #ifdef WIN32 "nmake" #else @@ -325,42 +327,69 @@ char *make_argv[ ARGUMENTS ] = { #endif }; -int make_argindex; -int cpp_argindex; -char *Imakefile = NULL; -char *Makefile = "Makefile"; -char *Template = "Imake.tmpl"; -char *ImakefileC = "Imakefile.c"; -boolean haveImakefileC = FALSE; -char *cleanedImakefile = NULL; -char *program; -char *FindImakefile(); -char *ReadLine(); -char *CleanCppInput(); -char *Strdup(); -char *Emalloc(); -void LogFatalI(), LogFatal(), LogMsg(); - -void showit(); -void wrapup(); -void init(); -void AddMakeArg(); -void AddCppArg(); -void SetOpts(); -void CheckImakefileC(); -void cppit(); -void makeit(); -void CleanCppOutput(); -boolean isempty(); -void writetmpfile(); - -boolean verbose = FALSE; -boolean show = TRUE; +static int make_argindex; +static int cpp_argindex; +static char *Imakefile = NULL; +static char *Makefile = "Makefile"; +static char *Template = "Imake.tmpl"; +static char *ImakefileC = "Imakefile.c"; +static boolean haveImakefileC = FALSE; +static char *cleanedImakefile = NULL; +static char *program; +static boolean verbose = FALSE; +static boolean show = TRUE; + +static char *FindImakefile(char *); +static char *ReadLine(FILE *, const char *); +static char *CleanCppInput(char *); +static char *Strdup(const char *); +static char *Emalloc(int); +static void LogFatal(const char *, ...); +static void LogMsg(const char *, ...); +static void Log(const char *, va_list); + +static void showit(FILE *); +static void wrapup(void); +static +#ifdef SIGNALRETURNSINT +int +#else +void +#endif +catch(int); +static void init(void); +static void AddMakeArg(char *); +static void AddCppArg(char *); +static void SetOpts(int, char **); +static void showargs(char **); +static void CheckImakefileC(const char *); +static boolean optional_include(FILE *, const char *, const char *); +static void doit(FILE *, const char *, char **); +#if (defined(DEFAULT_OS_NAME) || defined(DEFAULT_OS_MAJOR_REV) || \ + defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV)) +static void parse_utsname(struct utsname *, const char *, char *, const char *); +#endif +#if (defined(DEFAULT_OS_MAJOR_REV) || defined(DEFAULT_OS_MINOR_REV) || defined(DEFAULT_OS_TEENY_REV)) +static const char *trim_version(const char *); +#endif +#ifdef linux +static void get_distrib(FILE *); +static void get_libc_version(FILE *); +static void get_ld_version(FILE *); +#endif +#if defined(sun) && defined(__SVR4) +static void get_sun_compiler_versions(FILE *); +#endif +static void get_gcc_incdir(FILE *); +static boolean define_os_defaults(FILE *); +static void cppit(const char *i, const char *, const char *, FILE *, const char *); +static void makeit(void); +static void CleanCppOutput(FILE *, const char *); +static boolean isempty(char *); +static void writetmpfile(FILE *, const char *, int, const char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { FILE *tmpfd; char mak
Re: [cdesktopenv-devel] ANSIfication of imake
On 10 August 2012 at 15:09 Marc Balmer wrote:> > > > Am 10.08.2012 um 15:55 schrieb "ch...@chriswareham.net" > : > > > Hi folks, > > > > I've taken into account peoples comments with regard to patch format and not > > including changes that are just reformatting. The attached patch is solely > > for imake, adding function prototypes where they are missing, limiting > > linkage to static scope wherever possible and removing a bunch of GCC > > warnings. > > Why do you make all functions static? This way, the debugger will no longer > show the function names e.g. in a backtrace, iirc. > Really? [chris@dante ~]$ cat test.c #include static int myfunc(void) { int i; for (i = 0; i < 10; ++i) printf("This is iteration %d\n.", i); return i; } int main(int argc, char *argv[]) { myfunc(); return 0; } [chris@dante ~]$ gcc -g -o test test.c [chris@dante ~]$ gdb test GNU gdb (GDB) Fedora (7.4.50.20120120-49.fc17) (gdb) b 6 Breakpoint 1 at 0x4004e4: file test.c, line 6. (gdb) r Starting program: /home/chris/test Breakpoint 1, myfunc () at test.c:7 7for (i = 0; i < 10; ++i) The reason I make functions static is that it clearly marks them as not being part of an API. Regards, Chris > > > > Regards, > > > > Chris > > > > <0001-Convert-function-prototypes-and-signatures-to-ANSI-f.patch>-- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
Re: [cdesktopenv-devel] ANSIfication of imake
On 10 August 2012 at 16:18 "ch...@chriswareham.net" wrote: > On 10 August 2012 at 15:09 Marc Balmer wrote:> > > > > Why do you make all functions static? This way, the debugger will no longer > > show the function names e.g. in a backtrace, iirc. > > > > The reason I make functions static is that it clearly marks them as not being > part of an API. > Just to expand on this, by default C functions have external linkage and can be called from other translation units with just an extern declaration. This can become a pain in larger codebases, where a modification to what looks ostensibly like an "internal" function impacts code in other translation units. Because of the implicit external linkage, if the other translation units have already been compiled then they wont be recompiled because the dependency isn't explicit through the function being declared in a header and included in the other translation units. Tools like makdepend (which is in the CDE codebase) can track the header inclusions but not extern declarations. In other words, it means a static declaration means a programmer can optimise the function knowing it is only called from within the current translation unit. Regards, Chris-- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
[cdesktopenv-devel] Fixes to warnings in the ToolTalk libraries
Attached patch has seen a make clean && make World on my machine. There remains a signed / unsigned comparison issue, where an unsigned short is being read from an RPC message and then assigned to either a uid_t or gid_t, which are then compared to -1. This causes a warning when compiling the lib/tt/lib/db/tt_old_db.C source file. Comparisons of uid_t and gid_t types (which are unsigned on x86 Linux) to -1 occur elsewhere, but the warnings are masked by casts. Not sure whether these comparisons are a problem or not. Chris From d849c0c2939795bab341436f00aa4db01d9edbe8 Mon Sep 17 00:00:00 2001 From: Chris Wareham Date: Tue, 14 Aug 2012 11:49:53 +0100 Subject: [PATCH] Fix most of the following classes of warnings in the ToolTalk libraries: - Const strings referenced by non-const variables. - Incorrect format specifers for printing addresses - Unused variables - Signed comparison to unsigned Also fix an incorrect enumeration value in a switch statement. --- cde/lib/tt/lib/api/c/api_file.C| 2 +- cde/lib/tt/lib/api/c/api_storage.C | 6 +++--- cde/lib/tt/lib/api/dnd/ttdnd.c | 2 -- cde/lib/tt/lib/db/db_server.h | 4 ++-- cde/lib/tt/lib/db/db_server_clnt.C | 6 +++--- cde/lib/tt/lib/db/old_db_server_functions.C| 2 +- cde/lib/tt/lib/db/tt_db_client.C | 4 +--- cde/lib/tt/lib/db/tt_db_file.C | 2 +- cde/lib/tt/lib/db/tt_db_key.C | 2 +- cde/lib/tt/lib/db/tt_db_rpc_message_routines.C | 2 +- cde/lib/tt/lib/db/tt_db_rpc_routines.C | 14 +++--- cde/lib/tt/lib/mp/mp_auth.C| 16 cde/lib/tt/lib/mp/mp_auth_functions.C | 2 +- cde/lib/tt/lib/mp/mp_auth_functions.h | 6 +++--- cde/lib/tt/lib/mp/mp_c_procid.C| 1 - cde/lib/tt/lib/mp/mp_c_session.C | 1 - cde/lib/tt/lib/mp/mp_pattern.C | 1 - cde/lib/tt/lib/mp/mp_rpc_client.C | 2 -- cde/lib/tt/lib/tttk/ttdesktop.C| 2 ++ cde/lib/tt/lib/tttk/tttk2free.C| 6 +++--- cde/lib/tt/lib/util/tt_audit.C | 5 +++-- cde/lib/tt/lib/util/tt_audit.h | 2 +- cde/lib/tt/lib/util/tt_enumname.C | 2 +- cde/lib/tt/lib/util/tt_host.C | 2 +- cde/lib/tt/lib/util/tt_host_equiv.C| 1 - cde/lib/tt/lib/util/tt_trace.C | 7 --- cde/lib/tt/lib/util/tt_trace.h | 2 +- cde/lib/tt/lib/util/tt_trace_stream.C | 2 +- cde/lib/tt/lib/util/tt_xdr_utils.C | 2 +- 29 files changed, 51 insertions(+), 57 deletions(-) diff --git a/cde/lib/tt/lib/api/c/api_file.C b/cde/lib/tt/lib/api/c/api_file.C index 0608ed5..643cc7f 100644 --- a/cde/lib/tt/lib/api/c/api_file.C +++ b/cde/lib/tt/lib/api/c/api_file.C @@ -416,7 +416,7 @@ extern "C" { } Tt_status -_ttds_file_server(const char *filename, char **hostname) +_ttds_file_server(const char *filename, const char **hostname) { _Tt_c_file_ptr file; _Tt_db_results dbresults; diff --git a/cde/lib/tt/lib/api/c/api_storage.C b/cde/lib/tt/lib/api/c/api_storage.C index 298394b..45d53e8 100644 --- a/cde/lib/tt/lib/api/c/api_storage.C +++ b/cde/lib/tt/lib/api/c/api_storage.C @@ -173,13 +173,13 @@ void _Tt_api_stg_stack_elm:: print(FILE *f) const { - (void)fprintf(f,"_Tt_api_stg_stack_elm at %lx <",this); + (void)fprintf(f,"_Tt_api_stg_stack_elm at %p <",this); switch (entry_type) { case STACK_MARK: - (void)fprintf(f,"mark %ld>\n",addr); + (void)fprintf(f,"mark %p>\n",addr); break; case STACK_STORAGE: - (void)fprintf(f,"addr 0x%lx>\n",(long)addr); + (void)fprintf(f,"addr 0x%p>\n",addr); break; } } diff --git a/cde/lib/tt/lib/api/dnd/ttdnd.c b/cde/lib/tt/lib/api/dnd/ttdnd.c index 256acb4..780028b 100644 --- a/cde/lib/tt/lib/api/dnd/ttdnd.c +++ b/cde/lib/tt/lib/api/dnd/ttdnd.c @@ -68,7 +68,6 @@ ttdnd_init( { int mark = tt_mark(); const char *t, **vt; - int validtypecount, i; if (tt_ptr_error(tt_open())>TT_WRN_LAST) { @@ -238,7 +237,6 @@ _ttdnd_get_contents_callback(m, p) Tt_message m; Tt_pattern p; { - int xid; int chunknumber; int maxchunk; char *type; diff --git a/cde/lib/tt/lib/db/db_server.h b/cde/lib/tt/lib/db/db_server.h index 6ac3e1d..63b66cb 100644 --- a/cde/lib/tt/lib/db/db_server.h +++ b/cde/lib/tt/lib/db/db_server.h @@ -276,7 +276,7 @@ bool_t xdr_Tt_oidaccess_results(XDR*, _Tt_oidaccess_results*); struct _Tt_prop { struct { u_int propname_len; - char *propname_val; + const char *propname_val; } propname; long recnum; struct { @@ -862,7 +862,7 @@ bool_t xdr_tt_garbage_collect_results(XDR *, _tt_garbage_collect_results *); #include "db/tt_db_client_utils.h" -extern int *_tt_min_auth_level_1(char**, CLIENT*, clnt_stat *status); +extern int *_tt_min_auth_level_1(const char**, CLIENT*, clnt_stat *status); extern _Tt_isam_results *
Re: [cdesktopenv-devel] Fixes to warnings in the ToolTalk libraries
On 14 August 2012 at 12:01 "ch...@chriswareham.net" wrote: > Attached patch has seen a make clean && make World on my machine. There > remains a signed / unsigned comparison issue, where an unsigned short is being > read from an RPC message and then assigned to either a uid_t or gid_t, which > are then compared to -1. This causes a warning when compiling the > lib/tt/lib/db/tt_old_db.C source file. Comparisons of uid_t and gid_t types > (which are unsigned on x86 Linux) to -1 occur elsewhere, but the warnings are > masked by casts. Not sure whether these comparisons are a problem or not. > > Chris > > Needs the attached patch as well. Can't change the signature of an RPC generated stub ... Chris From 57ff4c0cecce686b6810e3e826b3e8e34f65a5ee Mon Sep 17 00:00:00 2001 From: Chris Wareham Date: Tue, 14 Aug 2012 12:59:44 +0100 Subject: [PATCH] Have to pass a const char * to function expecting char * here, otherwise it fails to link thanks to the declaration of a stub wth non-const param. --- cde/lib/tt/lib/db/db_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/lib/tt/lib/db/db_server.h b/cde/lib/tt/lib/db/db_server.h index 63b66cb..cd3b675 100644 --- a/cde/lib/tt/lib/db/db_server.h +++ b/cde/lib/tt/lib/db/db_server.h @@ -862,7 +862,7 @@ bool_t xdr_tt_garbage_collect_results(XDR *, _tt_garbage_collect_results *); #include "db/tt_db_client_utils.h" -extern int *_tt_min_auth_level_1(const char**, CLIENT*, clnt_stat *status); +extern int *_tt_min_auth_level_1(char**, CLIENT*, clnt_stat *status); extern _Tt_isam_results *_tt_isaddindex_1(_Tt_isaddindex_args*, CLIENT*); extern _Tt_isam_results *_tt_isbuild_1(_Tt_isbuild_args*, CLIENT*); extern _Tt_isam_results *_tt_isclose_1(int*, CLIENT*); -- 1.7.11.2 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
Re: [cdesktopenv-devel] [PATCH] const char maze: unbreak ToolTalk build
On 15 August 2012 at 03:13 Marcin Cieslak wrote:> >> Marcin Cieslak wrote: > > Follow up to de82eebdd56c02ae200bf2d9ec60df053919e7e7 > > --- > > cde/lib/tt/lib/db/tt_db_client.C | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/cde/lib/tt/lib/db/tt_db_client.C > > b/cde/lib/tt/lib/db/tt_db_client.C > > index 24d369c..22e210f 100644 > > --- a/cde/lib/tt/lib/db/tt_db_client.C > > +++ b/cde/lib/tt/lib/db/tt_db_client.C > > @@ -193,7 +193,7 @@ _Tt_db_results _Tt_db_client::connectToDB (const > > _Tt_string &hostname) > > // If dbVersion == 1, then we are talking to an old DB server > > static _tt_auth_level_results results; > > > > - const char *path = ""; > > + char *path = ""; > > clnt_stat rpc_status; > > int *result = (int *)NULL; > > result = _tt_min_auth_level_1(&path, dbServer, &rpc_status); > > Here is the failure I am getting: > > rm -f tt_db_client.o > CC -c -O2 -I../../lib -I../../../.. -I../../../../exports/include > -I../../../../imports/motif/include -I../../../../imports/x11/include > -DCSRG_BASED -DANSICPP -DMULTIBYTE -DNLS16 -DOSMAJORVERSION=9 > -DOSMINORVERSION=0 -DBSDSHLIB -fpic tt_db_client.C > tt_db_client.C: In member function '_Tt_db_results > _Tt_db_client::connectToDB(const _Tt_string&)': > tt_db_client.C:199: error: invalid conversion from 'const char**' to 'char**' > tt_db_client.C:199: error: initializing argument 1 of 'int* > _tt_min_auth_level_1(char**, CLIENT*, clnt_stat*)' > *** Error code 1 > > Stop in /.amd_mnt/radziecki/a/icybox/tmp/cdesktopenv/cde/lib/tt/lib/db. > *** Error code 1 > > Hi Marcin, An -fpermissive flag is being passed to the compiler on Linux, which turns this into a warning. The "correct" solution would be for the _tt_min_auth_level_1 function to take a const char * argument, but it's an RPC generated function. Removing the const qualifier simply changes the warning to a writable string one with the -fpermissive flag. Chris -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
[cdesktopenv-devel] XView
Hi folks, Apologies if this is a little too off topic, but I thought it might at least be of interest to some list members. I'm currently working on a 64 bit port of the XView libraries and clients (http://xview.xenu.tk/cgi-bin/view). This is based on a version of XView that includes as many of the third-party modifications were made to Sun's original release of the code as can be found. My work so far has been to ANSI'fy the olgx library, which is the graphics layer used by clients such as the olwm and olvwm window managers. I'm currently ANSI'fying and cleaning up olwm. The hard task is going to be making the variable argument lists in the xview library itself work on 64 bit systems, since they rely on typedef that results in code assuming 32 bit pointers ... Longer term, I'm going to suggest to the maintainer of the XView repository that we include the SlingShot and UIT libraries that sat on top of XView to provide extra widgets and a C++ API. I already have cleaned up version of SlingShot, but it currently awaits the 64 bit version of XView to see what further work is needed. Cheers, Chris -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk ___ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel