-
Notifications
You must be signed in to change notification settings - Fork 158
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
2.2.7d: is not gcc 14.x ready #283
Comments
gcc 14 apparently isn't discount ready, so if you could check these out for me (or send me a patch) that would be wonderful. |
For the 2.2 series, compile it with `CC="cc -std=c89". I got fed up with the warnings in v3, so there you can do the gcc of your choice. |
I know this issue is closed, but I worked on this while fixing RPM package builds for openSUSE before I saw this issue, and decided to attach this patch for what it is worth. I have checked that, with the following patch applied, discount 2.2.7d builds with GCC 14 and the tests succeed. ---
main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: discount-2.2.7d/main.c
===================================================================
--- discount-2.2.7d.orig/main.c
+++ discount-2.2.7d/main.c
@@ -100,14 +100,15 @@ free_it(char *object, void *ctx)
}
char *
-external_codefmt(char *src, int len, char *lang)
+external_codefmt(const char *src, const int len, void *lang)
{
int extra = 0;
int i, x;
char *res;
+ char *ec_lang = (char *)lang;
- if ( lang == 0 )
- lang = "generic_code";
+ if ( ec_lang == 0 )
+ ec_lang = "generic_code";
for ( i=0; i < len; i++) {
if ( src[i] == '&' )
@@ -117,11 +118,11 @@ external_codefmt(char *src, int len, cha
}
/* 80 characters for the format wrappers */
- if ( (res = malloc(len+extra+80+strlen(lang))) ==0 )
+ if ( (res = malloc(len+extra+80+strlen(ec_lang))) ==0 )
/* out of memory? drat! */
return 0;
- sprintf(res, "<pre><code class=\"%s\">\n", lang);
+ sprintf(res, "<pre><code class=\"%s\">\n", ec_lang);
x = strlen(res);
for ( i=0; i < len; i++ ) {
switch (src[i]) { |
The discount library fails to compile with GCC 14. The author of the library has already fixed the issue for discount v3.0.0+[1], but upgrading would require adjusting to some significant API changes. This commit applies a patch provided by Atri Bhattacharya for OpenSUSE[1] and also used by Gentoo.[2] 1: Orc/discount#283 2: https://bugs.gentoo.org/894560
Looks like last version build fails with latest gcc 14.x which is now used in fedora rawhide.
Build fails with
The text was updated successfully, but these errors were encountered: