Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #107784
| From | Ken Brody <kenbrody@spamcop.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: What are these functions (warning, push, disable) are in the macro definition? |
| Date | 2017-04-06 11:38 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <oc5n8b$mmk$1@dont-email.me> (permalink) |
| References | <eaeb380d-00bf-4156-bfac-f79acc47753e@googlegroups.com> |
On 4/5/2017 10:49 AM, fl wrote: > Hi, > > I have a MSVC project which has the following definitions. It builds > successfully on MSVC, but I don't understand what warning, push, pop > and disable are. > > Could you tell me that? > > Thanks, > > > ......................... > #if DSAS_MSVC > #define DSAS_MULTILINE_MACRO_END \ > __pragma( warning( push ) ) \ > __pragma( warning( disable:4127 ) ) \ > } \ > while( 0 ) \ > __pragma( warning( pop ) ) > #else /* #if DSAS_MSVC */ > #define DSAS_MULTILINE_MACRO_END \ > } \ > while ( 0 ) > #endif First, all pragma statements (except for those starting with "STDC") are implementation-defined, so you would have to check with a Microsoft-related group for full details. However, since I work in MSVC, I recognize it as a basic "temporarily disable warning number 4127, and then restore it to whatever state it was before". (That's the "push" and "pop" part.) Apparently, the actual contents of the macro will generate that warning, and the author wants to tell the compiler "yes, I know, but it's all good, so shut up about it already". You can check in a Microsoft-related group, or the MSVC docs for information on what, exactly, is warning number 4127. Or, a quick web search for "msvc warning 4127" will answer it as well. -- Kenneth Brody
Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread
What are these functions (warning, push, disable) are in the macro definition? fl <rxjwg98@gmail.com> - 2017-04-05 07:49 -0700 Re: What are these functions (warning, push, disable) are in the macro definition? scott@slp53.sl.home (Scott Lurndal) - 2017-04-05 15:25 +0000 Re: What are these functions (warning, push, disable) are in the macro definition? Keith Thompson <kst-u@mib.org> - 2017-04-05 13:46 -0700 Re: What are these functions (warning, push, disable) are in the macro definition? Ken Brody <kenbrody@spamcop.net> - 2017-04-06 11:38 -0400
csiph-web