On 2/13/23 23:09, Giacomo Comes wrote:
Hi,
I'm in the process of packaging CDE for opensuse.
While doing that I have found some issues and I have some doubts
that I would like to share with you.

Gulp.

1) CDE does not compile with gcc12. In many places it throws the error:
   error: control reaches end of non-void function [-Werror=return-type]
Attached there is a patch that makes CDE 2.5.1 compile with gcc12.
Please use such patch only as reference to see which functions
have problems. Do not consider the patch correct C code.
I just put some return statements here and there assuming
that whatever value was returned it would be ignored.
The purpose was only to have the build process proceed without errors
in order to find all the troubling functions.
While now urgent, this task needs to be done at some point.

Yeah, and the patch is not in git 'format-patch' format either which as I mentioned earlier causes more work to integrate, so I will not apply.

I can see that at least one of those changes is wrong anyway:

 static void *strmove(void *dest, const void *src) {
     memmove(dest, src, strlen(src) + 1);
+    return(0);
 }

This function should just:

return memmove(dest, src, strlen(src) + 1);

I'll fix that one myself.


2) If CDE is build with --prefix=/ust/dt (the default),
many binaries have rpath set. Since that is forbidden
by opensuse packaging rules, I'm forced to use the command
chrpath on such binaries.
configure has the option '--disable-rpath' but it does not seems to
work. Using such options or not does not make any difference.
Perhaps some Makefile.am needs adjust?

Hmmm... That will require investigation.

Seems this is handled by libtool, and apparently not very well. Post processing with chrpath might be the only way.



3) I have seen that in 2.5.1 only dtappgather is setuid.
In the past the list was bigger. Is that correct?
Is there any possibility that in the future no setuid
program will be necessary?


Yes, we've slowly been whittling these down.  only appgather is suid root now.  I think the fix for that is to not bother setting up the application symlinks in /var/dt - rather just set them up in the user's .dt/... directory hierarchy somehwere and have dtfile, etc look there instead.

A patch(es) is welcome.

I'll probably tackle it someday when I get the time.

4) When I run dtbuilder, if I click on any widget in the main
window the program crashes showing the following error messages:

X Error of failed request:  BadAlloc (insufficient resources for operation)
   Major opcode of failed request:  53 (X_CreatePixmap)
   Serial number of failed request:  14181
   Current serial number in output stream:  14184


No idea on that one.  dtbuilder needs a lot of work.

5) Since 2.5.0 if I start from a terminal some CDE programs
(dtterm, dtpad, dtinfo, etc.) the following warning appears:
   Warning: Missing charset in String to FontSet conversion
   Warning: Missing charset in String to FontSet conversion
That didn't happens in CDE up to 2.4.0

I've seen that too and is probably the result of some of the recent font changes that went in for utf8 support.  Would be nice to know what charsets are actually 'missing' here.

Unfortunately I'm not a font guy.  Not sure what's missing and what it would take to fix.


6) In the file contrib/desktopentry/cde.desktop
it would be a good idea to add the line:
   DesktopNames=CDE
In this way, after a login, the desktop manager will set the environment 
variables:
XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP

Done.

7) In the file programs/types/pgadmin.dt the line:
      ICON          pgadmin
should be:
      ICON          pgadmin3

Done.


8) /usr/dt/bin/dterror.ds does not work properly in CDE 2.5.x
It is build using programs/dtfile/dterror.src as source,
but is should be using programs/types/error.ds.src as source.
See databases/CDE-RUN.src in CDE up to 2.4.0

Hmm. yes, that one has the interpreter line set incorrectly to /etc/dt/...

Fixed.

But these scripts are not the same. They could possibly be made the same someday.  Patch (in git's format-patch format please) welcome.


9) the command:
   ksh -c 'echo "\n"'
prints a new line as output. So did the command:
   dtksh -c 'echo "\n"'
in CDE up to 2.3.2.
Since 2.4.0 instead the same dtksh command prints: \n
To restore the correct behavior ECHOPRINT=1 must be set
in programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh


This option might have been lost when I redid the way we set SHOPTS for the ksh93 build.

Fixed.

10) If, for example, I execure the action: 
ApplicationManager/Desktop_Tools/Environment Variables,
in the output window I see at the end:
------------
\n*** Select Close or Exit from the window menu to close this window ***
------------
instead of:
------------

*** Select Close or Exit from the window menu to close this window ***
------------
The problem seems to be that many dtactions use: sh -c '...; echo ...\n...'
in order to print a new line. Since, on linux, generally sh is bash, echo -e 
'\n'
is required to print the new line. On a system where sh is a different shell
(zsh, ksh, dash) echo will work as expected.
My workaround for linux is to replace: 'sh -c' with: 'ksh -c'
For that purpose I use the following command:
   sed -i 's@\([[:blank:]]\)\(sh -c\)@\1k\2@' programs/types/*.{dt,src}
I guess such change should work for any architecture.

Hmm.  Would it make sense to just use use dtksh for all of these?


11) the session is not saved correctly for dtterm, dtpad and dticon.
In CDE 2.5; If you open dtterm or dtpad and logout, on the next login
such windows are not restored.
In the files programs/dticon/utils.c, programs/dtpad/session.c and
programs/dtterm/DtTermMain.c there is code like this:
   sprintf(buf, "%s some further text", buf)
The C99 and POSIX.1-2001 standard specify that the result is undefined,
I think that since the introduction of the definition:
   #define _XOPEN_SOURCE 600
the sprintf code is not working anymore.
I'm attaching a patch that makes the saving of the session
work again. It is not elegant code, but it can be used
as a reference about what needs to be done.

Yikes - those are wrong.  We discovered several of these in the past - guess we missed a few.

Fixed by manually applying your diff.  PLEASE use /git format-patch/ in the future - makes my job a lot easier.

Thanks!

-jon


That's all for the moment.
Giacomo


_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

--
Jon Trulson

  "The less you know, the more you believe."
                           -- Bono
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to