linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristof Provost <Kristof@sigsegv.be>
To: Shriramana Sharma <samjnaa@gmail.com>
Cc: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: can't initialize a constant using another constant?
Date: Wed, 27 Feb 2008 08:09:57 +0000	[thread overview]
Message-ID: <20080227080957.GB13641@nereid> (raw)
In-Reply-To: <47C422E6.8050702@gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2008-02-26 20:02:06 (+0530), Shriramana Sharma <samjnaa@gmail.com> wrote:
> Dear list,
> 
> Quite some time since I wrote. I hope you are all keeping well. :)
> 
> A strange thing I ran across this evening. I was not allowed to do:
> 
> const double lunarSynodicMonth = 29.53059 ;
> const double daysLunarPhaseAngleTakesPerDegree = lunarSynodicMonth / 360.0 ;
> 
> I got the following error:
> 
> wdf-karanas.c:17: error: initializer element is not constant
> make: *** [wdf-karanas.o] Error 1
> 
> I would be grateful if anyone could shed some light. TIA.
What compiler are you using? 
I did a quick test on g++ 4.1.2 (x86_64) and it seemed to be accepted
without warning.

Kristof
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHxRrVUEZ9DhGwDugRAjZBAJ9pl0mGAJHPGbwePR0DVXoVh4kRzwCgnTn2
zzdeiILqi1JZ9M9VbUBewr8=
=KWWv
-----END PGP SIGNATURE-----

  reply	other threads:[~2008-02-27  8:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26 14:32 can't initialize a constant using another constant? Shriramana Sharma
2008-02-27  8:09 ` Kristof Provost [this message]
2008-02-27  8:33   ` Kristof Provost
2008-02-27 11:43 ` Glynn Clements
2008-02-27 23:35   ` Shriramana Sharma
2008-02-28  9:52     ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080227080957.GB13641@nereid \
    --to=kristof@sigsegv.be \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=samjnaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).