Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
What does the message warning macro replacement within a string literal mean?
What does the message warning macro replacement within a string literal mean?
✍: Guest
Some pre-ANSI compilers/preprocessors interpreted macro definitions like
#define TRACE(var, fmt) printf("TRACE: var = fmt\n", var)
such that invocations like
TRACE(i, %d);
were expanded as
printf("TRACE: i = %d\n", i);
In other words, macro parameters were expanded even inside string literals and character constants. (This interpretation may even have been an accident of early implementations, but it can prove useful for macros like this.)
Macro expansion is not defined in this way by K&R or by Standard C. (It can be dangerous and confusing: When you do want to turn macro arguments into strings, you can use the new # preprocessing operator, along with string literal concatenation (another new ANSI feature):
#define TRACE(var, fmt) \
printf("TRACE: " #var " = " #fmt "\n", var)
2015-12-14, 981👍, 0💬
Popular Posts:
Can you explain in brief how the ASP.NET authentication process works? ASP.NET does not run by itsel...
How To Dump the Contents of a Directory into an Array? - PHP Script Tips - Working with Directoris a...
How to create a thread in a program? You have two ways to do so. First, making your class "extends" ...
.NET INTERVIEW QUESTIONS - Can we use events with threading ? Yes, you can use events with thread; t...
What is the version information in XML? “version” tag shows which version of XML is used.