Re: [CIL users] Global Initializers

2013-09-26 Thread Jonathan Kotker
Thanks for the suggested fix, Gabriel -- I have added the patch file to my local CIL installation. I might have a unique use case for the Question, so this might not be worth patching for everybody. The way GameTime (my research software package) runs, it uses CIL to preprocess and simplify a file

Re: [CIL users] Global Initializers

2013-08-25 Thread Gabriel Kerneis
On Sun, Aug 25, 2013 at 01:26:08AM -0700, Jonathan Kotker wrote: > Apologies for reviving an old thread, but I'm revisiting this issue, trying > to see if I can patch a way around it, without having to constant-fold > floating point numbers. > > Looking at the suggested line (line 2656 of src/cil.

Re: [CIL users] Global Initializers

2013-08-25 Thread Jonathan Kotker
Apologies for reviving an old thread, but I'm revisiting this issue, trying to see if I can patch a way around it, without having to constant-fold floating point numbers. Looking at the suggested line (line 2656 of src/cil.ml), it does not look like that particular code should be throwing the erro

Re: [CIL users] Global Initializers

2013-08-06 Thread Jonathan Kotker
Ah okay, thanks, Gabriel. I will try to work around this then. On 6 August 2013 23:15, Gabriel Kerneis wrote: > On Wed, Aug 07, 2013 at 07:13:17AM +0100, Gabriel Kerneis wrote: > > You could try and patch src/cil.ml around line 2570 to handle that case > > Line 2656 and following actually (cons

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Wed, Aug 07, 2013 at 07:13:17AM +0100, Gabriel Kerneis wrote: > You could try and patch src/cil.ml around line 2570 to handle that case Line 2656 and following actually (constFoldBinOp). -- Gabriel -- Get 100% visibi

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Tue, Aug 06, 2013 at 11:03:00PM -0700, Jonathan Kotker wrote: > Is there a way to do this without having to preserve the ternary operator? > The conversion of the ternary operator is useful for easier analysis. No, the conversion basically calls Cil.constFold which fails on anything but ints an

Re: [CIL users] Global Initializers

2013-08-06 Thread Jonathan Kotker
Ah thanks, Gabriel! Is there a way to do this without having to preserve the ternary operator? The conversion of the ternary operator is useful for easier analysis. On 6 August 2013 22:59, Gabriel Kerneis wrote: > On Tue, Aug 06, 2013 at 03:55:02PM -0700, Jonathan Kotker wrote: > > int a = (in

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Tue, Aug 06, 2013 at 03:55:02PM -0700, Jonathan Kotker wrote: > int a = (int)((3.0 > 2.0) ? 1.0 : 4.0); > > CIL does not seem to like this code, complaining about global initializers > on the first line. However, this is not a problem if the constants are > integers. Is there any way to stop /