Error in make during compilation

13 views
Skip to first unread message

aaku...@ncsu.edu

unread,
Jan 31, 2019, 2:49:47 PM1/31/19
to ESESC
Hello Guys,

I am facing the following error when I try to compile. 

In file included from /home/akulkarn/projs/esesc/simu/libcore/BPred.cpp:49:0:
/home/akulkarn/projs/esesc/simu/libcore/IMLIBest.h: In member function ‘void IMLIBest::updatePredictor(AddrType, DataSign, bool, bool, AddrType)’:
/home/akulkarn/projs/esesc/simu/libcore/IMLIBest.h:1722:9: error: variable-sized object ‘skip’ may not be initialized
         };
         ^
make[2]: *** [simu/libcore/CMakeFiles/core.dir/BPred.cpp.o] Error 1
make[1]: *** [simu/libcore/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2

Could you please help me resolve this?

Thank you,
Aishwarya

aaku...@ncsu.edu

unread,
Jan 31, 2019, 4:09:34 PM1/31/19
to ESESC
I have attached the place where the error message points to!
Capture1.PNG

aaku...@ncsu.edu

unread,
Jan 31, 2019, 4:29:01 PM1/31/19
to ESESC


I made this change:

1721 //orig:                                                                                  
1722         //bool skip[nhist] = {
1723         //    false,
1724         //};
1725 //new:      
1726         bool skip[nhist] ; 
1727         skip[0]=false;                                                                   
1728       

I hope that is okay. Kindly correct me if I am wrong.

Jose Renau

unread,
Jan 31, 2019, 4:56:03 PM1/31/19
to es...@googlegroups.com, ESESC

The original initializes every entry to false, not just the 1st

Jose Renau
Professor, Computer Science & Engineering
--
You received this message because you are subscribed to the Google Groups "ESESC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esesc+un...@googlegroups.com.
To post to this group, send email to es...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sent from Mailspring

aaku...@ncsu.edu

unread,
Jan 31, 2019, 5:45:40 PM1/31/19
to ESESC


I changed a similar issue:

209     //original:
210     //#ifdef HASHED_RECORD
211     //  std::map<uint64_t, pipeline_info> window_sign_info;
212     //#elif
213     //  std::map<std::string, pipeline_info> window_sign_info;
214     //#endif
215     //changed:
216     #ifdef HASHED_RECORD
217       std::map<uint64_t, pipeline_info> window_sign_info;
218     #elif 1
219       std::map<std::string, pipeline_info> window_sign_info;
220     #endif


The original gave me an error for no condition being provided with elif.
In file included from /home/akulkarn/projs/esesc/simu/libcore/wavesnap.cpp:1:0:
/home/akulkarn/projs/esesc/simu/libcore/wavesnap.h:210:10: error: #elif with no expression
     #elif
          ^
make[2]: *** [simu/libcore/CMakeFiles/core.dir/wavesnap.cpp.o] Error 1

aaku...@ncsu.edu

unread,
Jan 31, 2019, 5:57:07 PM1/31/19
to ESESC
I tried running a similar code in GDB....the original code only initialized the first element of my array.
I have copy-pasted the code snippet which I ran in GDB:

bool skip[j] = {
            true,
        };
        for(int i=0;i<j;i++){
            printf("\n%d",skip[i]);       
            
        }
o/p:
1
0
0
0
0

So I believe this only initializes the first element of the array?

On Thursday, January 31, 2019 at 1:56:03 PM UTC-8, Jose Renau wrote:

The original initializes every entry to false, not just the 1st

Jose Renau
Professor, Computer Science & Engineering
On Jan 31 2019, at 1:29 pm, aaku...@ncsu.edu wrote:


I made this change:

1721 //orig:                                                                                  
1722         //bool skip[nhist] = {
1723         //    false,
1724         //};
1725 //new:      
1726         bool skip[nhist] ; 
1727         skip[0]=false;                                                                   
1728       

I hope that is okay. Kindly correct me if I am wrong.



Sent from Mailspring

aaku...@ncsu.edu

unread,
Jan 31, 2019, 6:20:18 PM1/31/19
to ESESC
Also, for the purpose of our code, this will not be a correctness issue since by default all entries of the array are anyway initialized to false. But in the future if they need to be initialized to true, then I believe only the first entry will be initialized to true if we follow the original code. 

Jose Renau

unread,
Jan 31, 2019, 6:34:40 PM1/31/19
to es...@googlegroups.com

my mistake, a bug because it should initialize everything to zero (feel free to create a pull request)

Jose Renau
Professor, Computer Science & Engineering
--
You received this message because you are subscribed to the Google Groups "ESESC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esesc+un...@googlegroups.com.
To post to this group, send email to es...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sent from Mailspring
Reply all
Reply to author
Forward
0 new messages