473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Visual C++ : Defect report or not?

I seem to recall that if a macro is evaluated and the macro is
defined, but a value for the macro does not exist, it should be
evaluated as zero, but I can't find it in the standard. There is a
program called Hoichess, that has the following include file:

#define EXPTOSTRING1(x) #x
#define EXPTOSTRING(x) EXPTOSTRING1(x)
#ifdef DEFAULT_HASHSIZE
std::cout << "\tDEFAULT_HASHSIZE " << EXPTOSTRING(DEFAULT_HASHSIZE)
<< "\n";
#endif
#ifdef DEFAULT_PAWNHASHSIZE
std::cout << "\tDEFAULT_PAWNHASHSIZE " <<
EXPTOSTRING(DEFAULT_PAWNHASHSIZE) << "\n";
#endif
#ifdef DEFAULT_EVALCACHESIZE
std::cout << "\tDEFAULT_EVALCACHESIZE " <<
EXPTOSTRING(DEFAULT_EVALCACHESIZE) << "\n";
#endif
#ifdef DEFAULT_BOOK
std::cout << "\tDEFAULT_BOOK " << EXPTOSTRING(DEFAULT_BOOK) << "\n";
#endif
#ifdef USE_UNMAKE_MOVE
std::cout << "\tUSE_UNMAKE_MOVE " << EXPTOSTRING(USE_UNMAKE_MOVE) <<
"\n";
#endif
#ifdef USE_IID
std::cout << "\tUSE_IID " << EXPTOSTRING(USE_IID) << "\n";
#endif
#ifdef USE_PVS
std::cout << "\tUSE_PVS " << EXPTOSTRING(USE_PVS) << "\n";
#endif
#ifdef USE_HISTORY
std::cout << "\tUSE_HISTORY " << EXPTOSTRING(USE_HISTORY) << "\n";
#endif
#ifdef USE_KILLER
std::cout << "\tUSE_KILLER " << EXPTOSTRING(USE_KILLER) << "\n";
#endif
#ifdef USE_NULLMOVE
std::cout << "\tUSE_NULLMOVE " << EXPTOSTRING(USE_NULLMOVE) << "\n";
#endif
#ifdef USE_FUTILITYPRUNING
std::cout << "\tUSE_FUTILITYPRUNING " <<
EXPTOSTRING(USE_FUTILITYPRUNING) << "\n";
#endif
#ifdef USE_EXTENDED_FUTILITYPRUNING
std::cout << "\tUSE_EXTENDED_FUTILITYPRUNING " <<
EXPTOSTRING(USE_EXTENDED_FUTILITYPRUNING) << "\n";
#endif
#ifdef USE_RAZORING
std::cout << "\tUSE_RAZORING " << EXPTOSTRING(USE_RAZORING) << "\n";
#endif
#ifdef USE_EVALCACHE
std::cout << "\tUSE_EVALCACHE " << EXPTOSTRING(USE_EVALCACHE) <<
"\n";
#endif
#ifdef EXTEND_IN_CHECK
std::cout << "\tEXTEND_IN_CHECK " << EXPTOSTRING(EXTEND_IN_CHECK) <<
"\n";
#endif
#ifdef EXTEND_RECAPTURE
std::cout << "\tEXTEND_RECAPTURE " << EXPTOSTRING(EXTEND_RECAPTURE)
<< "\n";
#endif
#ifdef MAXDEPTH
std::cout << "\tMAXDEPTH " << EXPTOSTRING(MAXDEPTH) << "\n";
#endif
#ifdef MAXPLY
std::cout << "\tMAXPLY " << EXPTOSTRING(MAXPLY) << "\n";
#endif
#ifdef MOVELIST_MAXSIZE
std::cout << "\tMOVELIST_MAXSIZE " << EXPTOSTRING(MOVELIST_MAXSIZE)
<< "\n";
#endif
#ifdef COLLECT_STATISTICS
std::cout << "\tCOLLECT_STATISTICS " <<
EXPTOSTRING(COLLECT_STATISTICS) << "\n";
#endif
#ifdef STATS_MOVELIST
std::cout << "\tSTATS_MOVELIST " << EXPTOSTRING(STATS_MOVELIST) <<
"\n";
#endif
#undef EXPTOSTRING
#undef EXPTOSTRING1

There is another header file that contains this:
/* $Id: config.h 1452 2007-10-30 16:11:59Z holger $
*
* HoiChess/config.h
*
* Copyright (C) 2004, 2005 Holger Ruckdeschel <ho****@hoicher.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
#ifndef CONFIG_H
#define CONFIG_H

/* Default size of main hash table */
#define DEFAULT_HASHSIZE "32M"

/* Default size of pawn hash table */
#define DEFAULT_PAWNHASHSIZE "4M"

/* Default size of evaluation cache */
#define DEFAULT_EVALCACHESIZE "4M"

/* Default location of opening book */
#define DEFAULT_BOOK "book.dat"

/* Use a single board in search tree, in connection with
Board::unmake_move().
* Otherwise, the board will be copied from node to node each time a
move is
* made. */
//#define USE_UNMAKE_MOVE

/* Use internal iterative deepening */
#define USE_IID

/* Use principal variation search */
#define USE_PVS

/* Use history table */
#define USE_HISTORY

/* Use killer heuristic */
#define USE_KILLER

/* Use null-move pruning */
#define USE_NULLMOVE

/* Use futility pruning */
#define USE_FUTILITYPRUNING

/* Use extended futility pruning */
#define USE_EXTENDED_FUTILITYPRUNING

/* Use razoring */
//#define USE_RAZORING

/* Use evaluation cache */
#define USE_EVALCACHE

/* Search extensions */
#define EXTEND_IN_CHECK
#define EXTEND_RECAPTURE

/* Maximum depth for full-width search */
#define MAXDEPTH 900

/* Maximum search tree depth (full-width + quiescence search) */
#define MAXPLY 1024

/* Maximum size of a Movelist */
#define MOVELIST_MAXSIZE 256

/* Collect statistics, e.g. hash table hits, cutoffs during search,
etc. */
#define COLLECT_STATISTICS

/* Collect statistics about maximum number of moves stored in a
movelist
* (expensive!) */
//#define STATS_MOVELIST

#endif // CONFIG_H
My Visual C++ compiler gives an error for any macro that does not have
a value defined such as:
#define USE_IID

Here is the list of errors coughed up:
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(19) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(19) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(22) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(22) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(25) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(25) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(28) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(28) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(31) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(31) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(34) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(34) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(37) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(37) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(43) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(43) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(46) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(46) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(49) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(49) :
error C2059: syntax error : '<<'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(61) :
warning C4003: not enough actual parameters for macro 'EXPTOSTRING1'
e:\pgn\winboard-engines\hoichess-0.10.2\src\debug_printconfig.h(61) :
error C2059: syntax error : '<<'
eval.cc

So my question is, is the compiler right to throw the errors, or am I
remembering how macros are supposed to operate incorrectly. Chapter
and verse from the current standard would be greatly appreciated.

P.S.
Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.

Nov 1 '07 #1
5 1782
On Oct 31, 8:11 pm, user923005 <dcor...@connx.comwrote:
Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.
g++ version?
vc++ version?
Nov 1 '07 #2
On Thu, 01 Nov 2007 00:52:57 -0000, andreyvul <an********@gmail.com>
wrote in comp.lang.c++:
On Oct 31, 8:11 pm, user923005 <dcor...@connx.comwrote:
Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.
g++ version?
vc++ version?
Context????

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Nov 1 '07 #3
On Oct 31, 10:12 pm, Jack Klein <jackkl...@spamcop.netwrote:
On Thu, 01 Nov 2007 00:52:57 -0000, andreyvul <andrey....@gmail.com>
wrote in comp.lang.c++:
On Oct 31, 8:11 pm, user923005 <dcor...@connx.comwrote:
Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.
g++ version?
vc++ version?

Context????
Version of g++ used to compile the above code and version of vc++ used
to compile the above code

Nov 1 '07 #4
On 2007-11-01 03:42, andreyvul wrote:
On Oct 31, 10:12 pm, Jack Klein <jackkl...@spamcop.netwrote:
>On Thu, 01 Nov 2007 00:52:57 -0000, andreyvul <andrey....@gmail.com>
wrote in comp.lang.c++:
On Oct 31, 8:11 pm, user923005 <dcor...@connx.comwrote:
Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.
g++ version?
vc++ version?

Context????
Version of g++ used to compile the above code and version of vc++ used
to compile the above code
I think that Jack Klein was referring to the fact that you removed all
the context from your reply, so anyone who had not read the OP would not
know what code worked fine in gcc. This problem is also demonstrated by
your reply in which you refers to "the above code" when there is no code
in your message.

--
Erik Wikström
Nov 1 '07 #5
"andreyvul" <an********@gmail.comwrote in message
news:11*********************@o3g2000hsb.googlegrou ps.com...
On Oct 31, 8:11 pm, user923005 <dcor...@connx.comwrote:
>Works fine with GCC, but of course a compiler does not make the rules
-- even though it can extend them.
g++ version?
vc++ version?
It is irrelevant to the question (about how the standard is to be
interpreted concering macros), which James Kanze answered in full.

But for your edification:

$ gcc --version
gcc.exe (GCC) 4.0.1 20050608 (prerelease)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Enterprise

Microsoft Visual C++ 2005 77642-113-3000004-41589

--
Posted via a free Usenet account from http://www.teranews.com

Nov 1 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Corrie Meyer | last post by:
Announcement: SwiftReports standard edition 1.0 for Visual Studio ..NET 2003 released by UniSwift. We are pleased to announce the first release of a fully-managed reporting tool for the...
2
by: GC | last post by:
HI, I'am using Crystal Report with visual Studio .NEt 2003 When i make a report using a store procedure, I can not see all the fields of the store proc and i'm suppose to see those fields. I'm...
8
by: Rod | last post by:
I've written a Visual Studio .NET application (WinForms app) and put a Crystal Reports for .NET report in it. It is a very simple application - one regular form and another with the crystal...
3
by: Stefan Slapeta | last post by:
Hi, please could anybody check if this defect is fixed in whidbey? struct X { X() {} X(X& x) {}
6
by: John Dalberg | last post by:
I don't know how much Microsoft is planning to price Visual Web Developer Express Edition. I heard rumors from free to $100. In my opinion I think it should make it free. The reason is to attract...
2
by: Shaw | last post by:
We develop ASP.NET based web application for a while, and don’t have defect (bug) reporting and tracking system for development right now. We consider using defect report and track software....
2
by: asterixgallier | last post by:
Hello i'm having problems with log4cxx when using inside an MFC application build with visual studio 2005. The Application starts and works normaly, but while exiting, inside the DEBUG window of...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
0
by: =?iso-8859-1?q?Keld_J=F8rn?= Simonsen | last post by:
The defect report and record of responses v1.25 for the C standard ISO/IEC 9899:1999 is now available from the WG14 web site at http://www.open-std.org/JTC1/SC22/WG14/ Best regards Keld Simonsen
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.