Project

General

Profile

[logo] 
 
Home
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #109

Autogenerated code produces incorrect C/C++ syntax

Added by Wilson Snyder over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
% Done:

0%


Description

This bug was cloned from Perl-RT, rt43629.

Email addresses have have been truncated.

Id:   43629
Status:        resolved
Queue:         SystemC-Vregs
Requestors:    Mark.Pettigrew@

Created:    Wed Feb 25 15:08:19 2009
Last Contact:     Wed Feb 25 16:29:48 2009
Closed:     Wed Feb 25 16:29:48 2009
Updated:     Wed Feb 25 16:29:48 2009 by WSNYDER

Wed Feb 25 15:08:25 2009 Mark.Pettigrew@ - Ticket created
Subject:  Bug: autogenerated code produces incorrect C/C++ syntax - SystemC::Vregs V1.461
Date:       Wed, 25 Feb 2009 13:49:56 -0500
To:       "'bug-SystemC-Vregs@'" <bug-SystemC-Vregs@>
From:       "Pettigrew, Mark" <Mark.Pettigrew@>
----------------------System Details-----------------------------
SystemC-Vregs: Distribution 1.461

Perl version:
perl -v

This is perl, v5.10.0 built for cygwin-thread-multi-64int
(with 6 registered patches, see perl -V for more detail)

Operating System:
uname -a
CYGWIN_NT-5.1 IIWIST-WS197 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
--------------------------------------------------------------------

It is syntactically incorrect to append semicolons to the function declaration and may confuse some compilers. This includes constructors and destructors. This affects the following files:

* Class.pm
* vderegs.cpp
* VregsRegInfo.h
* VregsClass.h

Class.pm
------------
* sub _class_h_write
1. change L328
,"{ ${wset}b,(val&BITMASK_WRITABLE)|(${wget}b)&~BITMASK_WRITABLE)); };\n");
To ,"{ ${wset}b,(val&BITMASK_WRITABLE)|(${wget}b)&~BITMASK_WRITABLE)); }\n");
2. Change L340
,"{ ${wset}b,(val&${fwritable})|(${wget}b)&~${fwritable})); };\n");
To ,"{ ${wset}b,(val&${fwritable})|(${wget}b)&~${fwritable})); }\n");
3 Change L475
$fl->print(" };\n");
to $fl->print(" }\n");
4. Change L481
," };\n");
To ," }\n");
5. Change L488
," };\n");
To ," }\n");

vderegs.cpp
---------------
1. change L114
};
To }

VregsRegInfo.h
--------
1. Change L72
, m_rstVal(rstVal), m_rstMask(rstMask), m_flags(flags) {};
To , m_rstVal(rstVal), m_rstMask(rstMask), m_flags(flags) {}
2. Change L142
VregsRegInfo() {};
To VregsRegInfo() {}
3. Change L143
~VregsRegInfo() {};
To ~VregsRegInfo() {}
4. Change L184
iterator(ByAddrMap::iterator addrIt) : m_addrIt(addrIt) {};
to iterator(ByAddrMap::iterator addrIt) : m_addrIt(addrIt) {}
5. Change L185
inline iterator operator++() {++m_addrIt; return *this;}; ///< prefix
to inline iterator operator++() {++m_addrIt; return *this;} ///< prefix
6. Change L186
inline operator VregsRegEntry* () const { return (m_addrIt->second); };
to inline operator VregsRegEntry* () const { return (m_addrIt->second); }
7. Change L232
};
To }
8. Change L245
iterator(ByNameMap::iterator nameIt) : s_nameIt(nameIt) {};
To iterator(ByNameMap::iterator nameIt) : s_nameIt(nameIt) {}
9. Change L246
inline iterator operator++() {++s_nameIt; return *this;}; ///< prefix
to
inline iterator operator++() {++s_nameIt; return *this;} ///< prefix
10. Change L247
inline operator VregsSpecInfo* () const { return (s_nameIt->second); };
To
inline operator VregsSpecInfo* () const { return (s_nameIt->second); }

VregsClass.h
--------
1. Change L111
: m_obj(obj), m_prefix(prefix) {};
To
: m_obj(obj), m_prefix(prefix) {}

--
Mark Pettigrew - Principal FPGA Engineer
Impact Science and Technology, Inc. - http://www.impactsci.com<http://www.impactsci.com/>
Address: 85 Northwest Boulevard, Nashua, NH 03063-4068
Phone: 603.459.2286 Fax: 603.459.2399
Email: mark.pettigrew@

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
Wed Feb 25 16:29:47 2009 WSNYDER - Correspondence added
Thanks for the patches. I'm guessing the ;'s were from before they were
inline functions.

I posted a 1.462 release with these fixes, expect it on CPAN in a hour
to day.

BTW if you have more bugs please file them at veripool.org, thanks.

Wed Feb 25 16:29:47 2009 RT_System - Status changed from 'new' to 'open'

Wed Feb 25 16:29:48 2009 WSNYDER - Status changed from 'open' to 'resolved'

Also available in: Atom