| Summary: | konsole compile errors on amd64 with gcc4 | ||
|---|---|---|---|
| Product: | [Applications] konsole | Reporter: | Ana Guerrero (Debian KDE maintainers) <ana> |
| Component: | general | Assignee: | Konsole Bugs <konsole-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
konsole compile fixes for amd64/gcc4
patch for gcc4 fix |
||
|
Description
Ana Guerrero (Debian KDE maintainers)
2005-03-15 16:34:26 UTC
Created attachment 10131 [details]
konsole compile fixes for amd64/gcc4
Waldo changed the (int) to a (long) in Jan. I/We thought that fixed this issue.
Revision 1.50 - (view) (download) (as text) (annotate) - [select for diffs]
Tue Jan 25 17:56:47 2005 UTC (7 weeks ago) by waba
Branch: MAIN
CVS Tags: HEAD, KDE_3_4_0_BETA_2, KDE_3_4_0_RELEASE
Branch point for: KDE_3_4_BRANCH
Changes since 1.49: +3 -3 lines
Diff to previous 1.49
gcc4/amd64 fix: Don't cast pointer to int, use long instead.
RCS file: /home/kde/kdebase/konsole/konsole/keytrans.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- kdebase/konsole/konsole/keytrans.cpp 2005/01/23 22:28:06 1.49
+++ kdebase/konsole/konsole/keytrans.cpp 2005/01/25 17:56:47 1.50
@@ -372,7 +372,7 @@
//printf("line %3d: ",startofsym);
getSymbol(); assertSyntax(sym == SYMName, "Name expected")
assertSyntax(syms->keysyms[res], "Unknown key name")
- int key = (int)syms->keysyms[res]-1;
+ int key = (long)( syms->keysyms[res] ) -1;
//printf(" key %s (%04x)",res.latin1(),(int)syms->keysyms[res]-1);
getSymbol(); // + - :
int mode = 0;
@@ -384,7 +384,7 @@
// mode name
assertSyntax(sym == SYMName, "Name expected")
assertSyntax(syms->modsyms[res], "Unknown mode name")
- int bits = (int)syms->modsyms[res]-1;
+ int bits = (long)syms->modsyms[res]-1;
if (mask & (1 << bits))
{
fprintf(stderr,"%s(%d,%d): mode name used multible times.\n",path.ascii(),slinno,scolno);
@@ -405,7 +405,7 @@
if (sym == SYMName)
{
assertSyntax(syms->oprsyms[res], "Unknown operator name")
- cmd = (int)syms->oprsyms[res]-1;
+ cmd = (long)syms->oprsyms[res]-1;
//printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1);
}
if (sym == SYMString)
That's true, though Waldo's commit made only 3 of the 4 changes proposed in the original patch. Furthermore, the proposed patch was improved after suggestions by Thiago Macieira (the thread I linked to explains this). I've attached this improved patch, but modified to apply to HEAD. | I've attached this improved patch, but modified to apply to HEAD. Where new patch? I had to add #include <stddef.h> in order to compile on gcc3.3.5 Created attachment 10168 [details]
patch for gcc4 fix
This work for you?
Yes, it works here. Thanks! CVS commit by hindenburg:
Fix compile errors on amd64 with gcc4
BUG: 101559
M +5 -4 keytrans.cpp 1.51
--- kdebase/konsole/konsole/keytrans.cpp #1.50:1.51
@@ -27,4 +27,5 @@
#include <stdio.h>
+#include <stddef.h>
#ifndef HERE
@@ -373,5 +374,5 @@ Loop:
getSymbol(); assertSyntax(sym == SYMName, "Name expected")
assertSyntax(syms->keysyms[res], "Unknown key name")
- int key = (long)( syms->keysyms[res] ) -1;
+ ptrdiff_t key = (ptrdiff_t)(syms->keysyms[res]) - 1;
//printf(" key %s (%04x)",res.latin1(),(int)syms->keysyms[res]-1);
getSymbol(); // + - :
@@ -385,5 +386,5 @@ Loop:
assertSyntax(sym == SYMName, "Name expected")
assertSyntax(syms->modsyms[res], "Unknown mode name")
- int bits = (long)syms->modsyms[res]-1;
+ ptrdiff_t bits = (ptrdiff_t)(syms->modsyms[res]) - 1;
if (mask & (1 << bits))
{
@@ -402,9 +403,9 @@ Loop:
// string or command
assertSyntax(sym == SYMName || sym == SYMString,"Command or string expected")
- int cmd = 0;
+ ptrdiff_t cmd = 0;
if (sym == SYMName)
{
assertSyntax(syms->oprsyms[res], "Unknown operator name")
- cmd = (long)syms->oprsyms[res]-1;
+ cmd = (ptrdiff_t)(syms->oprsyms[res]) - 1;
//printf(": do %s(%d)",res.latin1(),(int)syms->oprsyms[res]-1);
}
|