Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APInt.h:216: error: expected ‘,’ or ‘...’ before numeric constant #2301

Closed
edwintorok opened this issue Jan 19, 2008 · 7 comments
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla

Comments

@edwintorok
Copy link
Contributor

Bugzilla Link 1929
Resolution FIXED
Resolved on Nov 07, 2018 00:22
Version unspecified
OS Linux
CC @tkremenek

Extended Description

Build fails for svn r46191.

make[2]: Entering directory /home/edwin/llvm-svn/llvm/utils/TableGen' llvm[2]: Compiling FileParser.cpp for Release build In file included from /home/edwin/llvm-svn/llvm/include/llvm/ADT/APFloat.h:105, from /home/edwin/llvm-svn/llvm/include/llvm/ADT/StringExtras.h:19, from /home/edwin/llvm-svn/llvm/utils/TableGen/FileParser.y:17: /home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:216: error: expected ‘,’ or ‘...’ before numeric constant make[2]: *** [/home/edwin/llvm-svn/llvm/utils/TableGen/Release/FileParser.o] Error 1 make[2]: Leaving directory /home/edwin/llvm-svn/llvm/utils/TableGen'
make[1]: *** [TableGen/.makeall] Error 2
make[1]: Leaving directory `/home/edwin/llvm-svn/llvm/utils'
make: *** [all] Error 1

That line contains:
/// Profile - Used to insert APInt objects, or objects that contain APInt
/// objects, into FoldingSets.
void Profile(FoldingSetNodeID& ID) const;

@edwintorok
Copy link
Contributor Author

assigned to @tkremenek

@edwintorok
Copy link
Contributor Author

Environment:

$ g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --disable-libmudflap --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.3 20080114 (prerelease) (Debian 4.2.2-7)

$ uname -a
Linux lightspeed2 2.6.24-rc8-g8b2d1833-dirty #​4 Sat Jan 19 13:33:53 EET 2008 x86_64 GNU/Linux

@tkremenek
Copy link
Contributor

This looks like a potential macro conflict in preprocessed source for FileParser.cpp. I have committed r46193 which provides a hack to hopefully fix this problem ('ID' is renamed to 'id'):

http://llvm.org/viewvc/llvm-project?rev=46193&view=rev

Edwin: Can you confirm that this fixes the problem? Also, what would be helpful is if you could attach the preprocessed source for FileParser.cpp. Having a name conflict on something like the word 'ID' seems like badness to me, making believe that the root cause of this problem is elsewhere.

@edwintorok
Copy link
Contributor Author

preprocessed source, before updating from SVN
This is the preprocessed source, I see no conflicts on ID...

@edwintorok
Copy link
Contributor Author

Created an attachment (id=1344) [details]
preprocessed source, before updating from SVN

This is the preprocessed source, I see no conflicts on ID...

Ehrm, I was wrong, ID got expanded to 278.

@tkremenek
Copy link
Contributor

Thanks. It looks like ID is an enum value in the generated output of bison. Does the build work for you now?

@edwintorok
Copy link
Contributor Author

Thanks. It looks like ID is an enum value in the generated output of bison.
Does the build work for you now?

Yes, utils/TableGen builds now. The rest is still compiling, but I suppose those will be ok too.
Thanks.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants