Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Getting sensible information from gdb Date: Mon, 12 Oct 2015 08:00:55 -0700 Organization: None to speak of Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="29289"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196QhPhuIyzuqTnkFJfdtWH" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:MbiVR4xd7Z0/BZ2eEen3Kj6wXmg= sha1:CC3fHSSjtp+tpN4zcDUW5ymZsCc= Xref: csiph.com comp.lang.c:72618 "Morten W. Petersen" writes: > On 12.10.2015 06:59, Ian Collins wrote: [...] >> "#define CONST const" >> >> Why would you male const optional? What is const is and what isn't isn't! > > Profiling. What are the speed benefits of constants.. mostly > out of curiosity. "const" and "constant" are two very different things, even though the keyword "const" is obviously derived from the English word "constant". The "const" keyword really means "read-only". A "constant" is a literal, such as 42, 1.23, or 'x'. A "constant expression" is one that can be evaluated at compile time. For example, this: const int r = rand(); is perfectly valid and meaningful; r is const, but obviously not constant. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"