Discussion:
What is the purpose of the preprocessor constant _U_ in the source code?
jscott
2004-09-16 22:33:16 UTC
Permalink
I'm trying to compile the Ethereal source under WinXP, and there are
compile errors caused by the _U_ preprocessor constant. In the project
settings it's defined to be "", an empty string. This causes a compile
error," Newline in constant." I tried redefining it to nothing, but this
doesn't help; I just get a different compiler error message.



Jim Scott
Guy Harris
2004-09-16 22:45:29 UTC
Permalink
It's used to mark unused function arguments in cases where those arguments
*have* to be present (e.g., because a pointer to the function is being
passed to a routine that expects a function with a given signature), so
that compiler warnings about the argument are suppressed. (If the
argument doesn't have to be there, it should be removed - but perhaps the
bug is that it *should* be used but isn't being used.)

For GCC, it's defined to be a string that tells GCC not to warn that the
argument is unused; for other compilers, it's defined as an empty string.
Post by jscott
I'm trying to compile the Ethereal source under WinXP, and there are
compile errors caused by the _U_ preprocessor constant. In the project
settings it's defined to be "", an empty string. This causes a compile
error," Newline in constant."
There's no newline in ""; perhaps the compiler is confused?

Note that if by "project" in "project settings" you mean some project file
for Visual Studio or whatever, we don't supply those files, we just supply
a Makefile for nmake - and that definitely works with a command-line
build. If you're trying to make a Visual Studio project that's not just a
"Makefile project", you'll have to figure it out yourself or hope that
somebody else has figured it out.
Ulf Lamping
2004-09-17 05:28:30 UTC
Permalink
I’m trying to compile the Ethereal source under WinXP, and there are
compile errors caused by the _/U/_ preprocessor constant. In the
project settings it’s defined to be “”, an empty string. This causes a
compile error,” Newline in constant.” I tried redefining it to
nothing, but this doesn’t help; I just get a different compiler error
message.
The _U_ is used together with the gcc compiler, to mark unused
parameter. With MSVC compilers, it should just do nothing.

Please provide the exact error messages, I don't have a cristal ball at
hand ...

Regards, ULFL

Loading...