Welcome to the Builder Academy

Question GCC 12 to 14 Compile Issues

More
26 Feb 2025 19:04 #10554 by soth
Hello,
Been a bit since I have been here, but I recently switched vm's and the compile is gcc 14 where I used to have 12. I am getting a compile error and wanted to see if there was an easy way to switch back to gcc 12 on Fedora or am I missing something with this block of code.

Thanks!
Code:
act.wizard.c: In function 'do_zstat_room': act.wizard.c:5459:29 error: passing argument 1 of 'sprintbit' makes integer from pointer without a cast [-Wint-conversion] 5459 sprintbit(zone_table[zone].zone_flags, zone_bits, buf2, sizeof(buf2));

Please Log in or Create an account to join the conversation.

More
26 Feb 2025 19:39 #10555 by ironfist
Did you convert to 128bit flags?  It looks like you may have tried to convert at some point but missed a line.

~/projects/tbamud/tbamud/src$ grep -in 'zone_flags' *.h

db.h:184:  int zone_flags[ZN_ARRAY_MAX];  /* Zone Flags bitvector */

Default circle was just an int, not an array I believe.

Current Tba has changed a bit with the function name changing to the below (as far as I can tell):
Code:
/* single zone printing fn used by "show zone" so it's not repeated in the    code 3 times ... -je, 4/6/93 FIXME: overflow possible */ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int listall) {   size_t tmp;   if (listall) {     int i, j, k, l, m, n, o;     char buf[MAX_STRING_LENGTH];     sprintbitarray(zone_table[zone].zone_flags, zone_bits, ZN_ARRAY_MAX, buf);

Please Log in or Create an account to join the conversation.

More
26 Feb 2025 19:49 #10556 by soth
Replied by soth on topic GCC 12 to 14 Compile Issues
Hey Ironfist,

From what you posted it the same code I have in act.wizard.c and db.h looks like. I am running a recent tbamud, probably 3 years old, but I didn't have these issues on my other fedora VM. All I did was copy the files from vm1 to vm2 and a newer distro of fedora 41. The only thing I could think of would be due to the gcc version went from 12 to 14, but like I said it's been a year or more since I have been working on the mud.

Thanks!

Please Log in or Create an account to join the conversation.

More
26 Feb 2025 20:02 #10557 by ironfist
hmm, very strange

When I grep for the line from your error message, I get nothing in current tba

grep -in 'sprintbit(zone_table' *.[ch]

If that was in the code it would need to be a sprintbitarray along with different arguments instead of sprintbit... hm, what do you see when you search on that above?

Please Log in or Create an account to join the conversation.

More
26 Feb 2025 20:12 - 26 Feb 2025 20:19 #10558 by soth
Replied by soth on topic GCC 12 to 14 Compile Issues
In the old fedora VM I get this.
Code:
act.wizard.c:5458:  sprintbit(zone_table[zone].zone_flags, zone_bits, buf2, sizeof(
buf2));

In the new fedora VM I get this.
Code:
rg: regex parse error:      (?:sprintbit(zone_table)      ^ error: unclosed group

It does appear in fedora 41 VM act.wizard.c the same as 37 VM though.  Guess the regex pattern is different from 37 to 41 fedora or a dependency is not installed.

I just wonder if it was a clean copy/paste from vm to vm?

Kevin
Last edit: 26 Feb 2025 20:19 by soth. Reason: Added Info from 41 VM

Please Log in or Create an account to join the conversation.

More
26 Feb 2025 20:19 - 26 Feb 2025 20:41 #10559 by ironfist
I'm not sure on that part, but the older compiler might have allowed sprintbit because it figured out it was the first int in the array of the pointer you were addressing.  I tried setting CC in the makefile to gcc-12 on ubuntu... It seemed to take those arguments if you want to try that.

# C compiler to use

CC = gcc-12

Edit: Maybe the ' single quote got knocked off or the ] on the search
Last edit: 26 Feb 2025 20:41 by ironfist. Reason: regex

Please Log in or Create an account to join the conversation.

Time to create page: 0.282 seconds