Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: putting stuff in the text segment Message-ID: <54574@sun.uucp> Date: 26 May 88 02:32:04 GMT References: <3813@lynx.UUCP> Sender: news@sun.uucp Distribution: na Lines: 15 > Does a widely-accepted syntax extension to put data structures in the > text segment exist? We are thinking about adding something like this > to our compiler in order to reduce memory use by oft-forked large > applications. I had in mind a couple of new storage classes, maybe > "rom" and "staticrom". Try "const"; it's in the current ANSI C draft (and will probably be in future ones), and "stick this in ROM" is one valid interpretation of it, as is "stick this into the text segment". You needn't feel obliged to implement all the ANSI C semantics (such as "assignments to 'const' objects are disallowed, as are sneaky back-door ways of doing those assignments") unless and until you have an ANSI C compiler (but be prepared for them). Grab the ANSI C spec for a detailed description; it's not a simple storage class.