Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 913 Bytes

compiler-warning-level-3-c4161.md

File metadata and controls

38 lines (28 loc) · 913 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 3) C4161
Compiler Warning (level 3) C4161
08/27/2018
C4161
C4161
03d3be61-83f1-4009-8310-8758ab67055f

Compiler Warning (level 3) C4161

#pragma pragma(pop...) : more pops than pushes

Remarks

Because your source code contains one more pop than pushes for pragma pragma, the stack may not behave as you expect. To avoid the warning, be sure that the number of pops does not exceed the number of pushes.

Example

The following example generates C4161:

// C4161.cpp
// compile with: /W3 /LD
#pragma pack(push, id)
#pragma pack(pop, id)
#pragma pack(pop, id)   // C4161, an extra pop

#pragma bss_seg(".my_data1")
int j;

#pragma bss_seg(push, stack1, ".my_data2")
int l;

#pragma bss_seg(pop, stack1)
int m;

#pragma bss_seg(pop, stack1)   // C4161