[sv-cc] Old-style function prototypes in svdpi.h

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Sun Jan 29 2012 - 19:54:43 PST

The following was posted in the Verification Guild forum at http://verificationguild.com/modules.php?name=Forums&file=viewtopic&t=4366:

The svdpi.h file specified by IEEE 1800 gets compilation warnings when compiled with gcc 3.4.6 using the -Wstrict-prototypes flag.

For instance this function prototype:
XXTERN const char* svDpiVersion();

My 1988 K&R book says of the above syntax: "This special meaning of the empty argument list is intended to permit older C programs to compile with new compilers. But it's a bad idea to use it with new programs. If the function takes arguments, declare them; if it takes no arguments, use void." Certainly, svdpi.h is one of these post-1988 "new programs."

I believe that svdpi.h should change the four offending lines to the modern syntax:
XXTERN const char* svDpiVersion(void);
XXTERN svScope svGetScope(void);
XXTERN int svIsDisabledState(void);
XXTERN void svAckDisabledState(void);

The same may apply to some of the other .h files specified in the standard, but I haven't checked.

Paul

Shalom Bresticker
Intel LAD DA, Jerusalem, Israel
+972 2 589 6582 (office)
+972 54 721 1033 (cell)
http://www.linkedin.com/in/shalombresticker

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Jan 29 19:55:06 2012

This archive was generated by hypermail 2.1.8 : Sun Jan 29 2012 - 19:55:19 PST