Error: aggregate value used where an integer was expected

390 views
Skip to first unread message

Larissa Braz

unread,
Mar 5, 2018, 1:40:01 PM3/5/18
to vim_dev
Hi,

I'm getting the following compilation error message:

misc2.c:2566:3: error: aggregate value used where an integer was expected
return TERMCAP2KEY(modifier_keys_table[i + 1],
^

OS: Ubuntu 14.04 - LTS
Compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

Thank you,

Bram Moolenaar

unread,
Mar 5, 2018, 4:00:01 PM3/5/18
to vim...@googlegroups.com, Larissa Braz
Strange, can't guess why this would happen. Is TERMCAP2KEY() overruled
somewhere? That would cause an error though.

--
Friends? I have lots of friends! In fact, I have all episodes ever made.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Larissa Braz

unread,
Mar 8, 2018, 9:56:23 AM3/8/18
to vim_dev

Hi, there is only one definition of TERMCAP2KEY().

Maybe the code should be "return (int) TERMCAP2KEY(modifier_keys_table[i + 1], modifier_keys_table[i + 2]);"?

Bram Moolenaar

unread,
Mar 8, 2018, 3:22:00 PM3/8/18
to vim...@googlegroups.com, Larissa Braz

> Hi, there is only one definition of TERMCAP2KEY().
>
> Maybe the code should be "return (int)
> TERMCAP2KEY(modifier_keys_table[i + 1], modifier_keys_table[i + 2]);"?

Maybe the problem is with using a negative value of char_u.
Try this:

#define TERMCAP2KEY(a, b) (-((int)(a) + ((int)(b) << 8)))


--
The acknowledged parents of reengineering are Michael Hammer and James Champy.
When I say they're the "parents" I don't mean they had sex - and I apologize
for making you think about it. I mean they wrote the best-selling business
book _Reengineering the Corporation_, which was published in 1993.
Businesses flocked to reengineering like frat boys to a drunken
cheerleader. (This analogy wasn't necessary, but I'm trying to get my mind
off that Hammer and Champy thing.)
(Scott Adams - The Dilbert principle)
Reply all
Reply to author
Forward
0 new messages