Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 904 Bytes

compiler-warning-level-1-c4794.md

File metadata and controls

30 lines (23 loc) · 904 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4794
Compiler Warning (level 1) C4794
11/04/2016
C4794
C4794
badc9c36-fa1a-4fec-929b-7bfda7a7b79f

Compiler Warning (level 1) C4794

segment of thread local storage variable 'variable' changed from 'section name' to '.tls$'

You used #pragma data_seg to put a tls variable in a section not starting with .tls$.

The .tls$x section will exist in the object file where __declspec(thread) variables are defined. A .tls section in the EXE or DLL will result from these sections.

Example

The following sample generates C4794:

// C4794.cpp
// compile with: /W1 /c
#pragma data_seg(".someseg")
__declspec(thread) int i;   // C4794

// OK
#pragma data_seg(".tls$9")
__declspec(thread) int j;