Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Is this kosher? Keywords: Does a static exist outside its block? Message-ID: <11749@smoke.BRL.MIL> Date: 6 Dec 89 15:11:48 GMT References: <1047@dinorah.wustl.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <1047@dinorah.wustl.edu> art@dinorah.wustl.edu (Arthur B. Smith) writes: > In particular, is it safe to assign the address of the string >literal in the list and assume that the contents of that address do >not change when in another function? Yes, string literals have static storage duration. Only register and auto objects end their lifetimes when leaving the block. Be careful you don't feed a string literal to free(). >I cannot find anywhere that indicates the linkage for the string constant. Linkage is not relevant here. (Linkage basically has to do with whether or not the identifier is visible to other translation units.)