Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small build fixes #98

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

small build fixes #98

wants to merge 21 commits into from

Conversation

hramrach
Copy link
Contributor

@hramrach hramrach commented May 16, 2024

A number of small build fixes

@hramrach hramrach changed the title wayland: Fix mlconfig build small build fixes May 17, 2024
@hramrach hramrach force-pushed the misc branch 2 times, most recently from 8ca9d56 to ff11006 Compare May 17, 2024 21:39
libtool: link: gcc main.o mc_combo.o mc_char_encoding.o mc_im.o mc_tabsize.o mc_logsize.o mc_font.o mc_color.o mc_radio.o mc_space.o mc_alpha.o mc_ctl.o mc_sb_view.o mc_wall_pic.o mc_bgtype.o mc_io.o mc_io_pty.o mc_io_file.o mc_pty.o mc_char_width.o mc_flags.o mc_auto_detect.o mc_ratio.o mc_wordsep.o mc_unicode_areas.o mc_geometry.o mc_click.o mc_opentype.o -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I../../baselib/include -DUSE_WAYLAND -DOPENSSL_LOAD_CONF -DUSE_LIBSSH2 -DHAVE_PTHREAD -g -O2 -I../../xwindow -I../../vtemu -I../../common -I../../common -I../../inputmethod -I/usr/local/include -DSYSCONFDIR=\"/usr/local/etc\" -DLOCALEDIR=\"/usr/local/share/locale\" -DXDATADIR=\"/usr/local/share\" -DLIBDIR=\"/usr/local/lib64\" -o .libs/mlconfig  -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype ../../baselib/src/.libs/libpobl.so -ldl -pthread
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: mc_font.o: undefined reference to symbol 'XListFonts'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:70: mlconfig] Error 1
zmodem uses dirname but does not include the header that declares it.
This is an error with gcc14. Same header is used for base name and
dirname, use HAVE_BASENAME for detection of the header.
missing prototype causes an error with gcc14
In a few places empty string is passed as ef_char_t*. Pass in a pointer
to zero ef_char_t instead.
This refcount code is incrementing/decrementing a pointer casting it to
int. Cast to void * instead to avoid error in gcc14.
There are users ob basename that pass in a const string.

This is an error with gcc14. It's possible to make a copy of the string
before passing it to basename but there is also another way: avoid
modifiyng the string in basename.

basename can return pointer to the start of the base part without
changing the string. However, it cannot strip trailing slashes.
The write function does not modify the passed-in string.

Some users pass in a const string which is an error with gcc14.

Declare the written data parameter as const.
The code calls a function that takes FriBidiParType pointer but passes
in FriBidiCharType. It looks liek this is equivalent because the initial
values of both enumerations are the same but the type mismatch causes
an error in gcc14
In a few places where the GTK function returns a base type the cast to
subtype is missing causing an error with gcc14
mlterm uses a trick that the C standrds committee hates: it allocates a
structure and its members as one memory block so it can be freed as one
block without complex recursive freeing of members.

To vaoid an error with gcc14 instead of assigning pointer to the
structure increased by one to its member assign the malloc result into a
temporary void pointer, and use void pointer arithmetic to get the
allocated member address.

Another variant is allocating a memory block and assigning it to
multiple incompatible pointes at once.
These local variables are used to store a pointer of different type
causing type mismatch error in gcc14.
There are a couple local functions that declare argument type not
compatible with what is passed in, adjust them.
Strings are a wild mix of char *, u_char *, XChar2b * and others
depending on where they came from. Add cast where gcc14 reports error.
XEvent is an union with different fields depending on the event type.

C language committe hates wire protocols, and in gcc14 they are endless
source of errors. Add some type casts.

Also for struct sockaddr.
There are a few places where type-mismatched pointers to display
structures or its members are used.

In a few places the type can be adjusted, add casts elsewhere.
In a few places pointers to data buffers of different type are used, and
gcc14 reports this as an error. Add casts.
The 'user' variable is passed to bl_parse_uri which modifies the content
as well as assigned const return from bl_get_user_name. Use a temporary
variable to avoid the warning.
The preedit text is passed to utf-8 parser which technically does not
modify it but it shares interface with the vt parser which may modify
the text due to combining characters. Drop the const to avoid warning.
The recv_dir is assigned to dst_path in one leg of the function, and in
another leg dst_path is passed to custom mkdir implementation which
modifies the string. With that it cannot be const.
The font name received from gtk_entry_get_text is a const string. As far
as gcc can tell the combo functions do not modify the string, they can
accept a const string as well. Declare it as const to avoid warning.
@hramrach hramrach force-pushed the misc branch 2 times, most recently from e00e4e9 to 85b9eb9 Compare May 20, 2024 09:27
@hramrach
Copy link
Contributor Author

Should mostly resolve #92

@arakiken
Copy link
Owner

Thank you.
The changes you pointed out have been mostly reflected.

@hramrach
Copy link
Contributor Author

Thanks for looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants