To Kent: -fwritable-strings in GCC Linux

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

To Kent: -fwritable-strings in GCC Linux

Post by Merk »

Heya,

in GCC 4.0 for Linux, they've taken out the -fwritable-strings command-line option. In my research, I haven't found any alternative. The documentation says to use a named array (or something like that), or some other method that doesn't require string constants to be treated as non-constant. Where I've found people encountering this error, they've had to install an older version of GCC, such as version 2.95, to use this flag when compiling.

I've run a Linux binary of the HE Hugo Engine on my Linux boxes (primarily used as web servers, but I do some command-line stuff too) before. Today, I was trying to compile from the source code. I used the main Hugo source and the Linux source, and the makefile works fine. I get an HE executable. It works, because run without a parameter I'm told the correct format to use HE with the name of a file. So it runs. But when I supply the name of a file, it immediately segfaults.

Hence, I looked into your note in the "porting" info to use -fwritable-strings, and then my realization that it's no longer supported in GCC.

Any chance that the next version of the Hugo Engine will remove the need for writable strings by doing "whatever it's doing" in a different way?

---- Mike.

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

Thanks for the heads up. I'm not near a Unix/Linux machine where I can test a build, but is that switch still required? I had thought I'd removed its necessity on the basis of being a good programming citizen some time ago, but I may be wrong. If I'm wrong, it should be fixed, because it's probably bad programming karma to be doing what I'm doing to require it.

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

Okay, sorry, I just read your post more carefully this time, and saw the word "segfault". That isn't what we in the business call "working".

Things are really busy right now, but when I get a chance to look into it, I will.

User avatar
Ice Cream Jonsey
Posts: 28923
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Kent wrote:Things are really busy right now, but when I get a chance to look into it, I will.
I'm just throwing this out there: I'm guessing it would be helpful for Merk and I to keep track of Hugo oddities together, and then when the time comes for when you are ready for the list, we could provide it. The way my mind works, it's distracting to have a nebulous smattering of things on a "to do" list that are across websites and e-mails, so if we centralized it, it might be helpful.

(At the same time, I am hesitant to put up a Wiki for it that's open to the public, because I don't want to create the impression that Hugo is in any way not perfectly ready for game creation and play. So I need to think on this.)

I just want to throw it out in the open that you can say something like, "Hey, Robb, if you could gather up all the outstanding Hugo issues and document them someplace I'd appreciate it" and I would totally do that for you.
the dark and gritty...Ice Cream Jonsey!

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

Well, it works in that after it compiles, it runs without a segmentation fault as long as it's not actually running a game. In other words, I can run "he" and it'll give me some usage information about supplying the name of a Hugo hex file to run. So the binary *did* compile okay.

It's only when I run it with a .hex file name as a paramater that I get the segfault. Granted, I may have jumped to the conclusion that it's because of the -fwritable-strings compile flag, when maybe that's not it. In my research, I did see that the compiler was supposed to *complain* if it hits code that would trigger a segfault at runtime, where the -fwritable-strings would previously have taken care of it, and no such compile error happens.

So, I dunno. Maybe there is something else missing. I compiled with the included makefile, and with the base Hugo source and the Linux source unarchived. I didn't add anything else (no other source packages) to it, and it didn't complain about missing dependencies or anything.

Maybe it's another matter entirely. I gave up when I thought it was probably the -fwritable-strings thing...

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

And yeah, I can help put together some kind of bug and/or wish list for Hugo. I think everything I've found, I've posted here, so it should be easy to dig it all up. :)

Kent!

Post by Kent! »

A list sounds like a pretty good idea. Partly because then I might feel some guilt if I don't actually get those things done when I finally have the time.

Roody_Yogurt
Posts: 2181
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Whatever, you guilty bastard.

Post Reply