# \[STRUCTS\] How to fix warning "The identifier 'GENERATED\_USTRUCT\_BODY' was detected in a block being skipped. Was this intentional?"

**URL:** <https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064>\
**Category:** C++\
**Tags:** UE-5, Struct, ustruct, unreal-engine, CPP, question, structs\
**Created:** [January 23, 2023, 5:02am UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064 "2023-01-23T05:02:01Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [January 23, 2023, 5:02am UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/1 "2023-01-23T05:02:01Z")

</div>

Hi there,  
I am trying to create a struct consisting of a few parameters. However, when compiling the solution, the mentioned warning occurs. Here is a snippet of the code. Any help is appreciated:

USTRUCT(BlueprintType)  
struct FFoliageEffectData  
{  
GENERATED\_USTRUCT\_BODY()  
public:

```
UPROPERTY(EditAnywhere)
uint8 bDisabled : 1;

// True to check foliage/ecosystem system for this mesh. False to save frametime. 
UPROPERTY(EditAnywhere)
uint8 bCheckFoliage : 1;

// True to check grass system for this mesh. False to save frametime. 
UPROPERTY(EditAnywhere)
uint8 bCheckGrass : 1;

UPROPERTY(EditAnywhere)
UStaticMesh* FoliageMesh = nullptr;

```

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [January 23, 2023, 10:07am UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/2 "2023-01-23T10:07:59Z")

</div>

Does this work? I changed the type of the variables from `uint8` to `bool`.

```auto
USTRUCT(BlueprintType)
struct FFoliageEffectData
{
GENERATED_USTRUCT_BODY()
public:

UPROPERTY(EditAnywhere)
bool bDisabled;

// True to check foliage/ecosystem system for this mesh. False to save frametime. 
UPROPERTY(EditAnywhere)
bool bCheckFoliage;

// True to check grass system for this mesh. False to save frametime. 
UPROPERTY(EditAnywhere)
bool bCheckGrass;

UPROPERTY(EditAnywhere)
UStaticMesh* FoliageMesh = nullptr;

```

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [January 23, 2023, 12:59pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/3 "2023-01-23T12:59:12Z")

</div>

Not sure if this will fix it but I’m using:

```auto
GENERATED_BODY()

```

Instead of:

```auto
GENERATED_USTRUCT_BODY()

```

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [January 23, 2023, 1:08pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/4 "2023-01-23T13:08:07Z")

</div>

Could be a solution as well… I have noticed that the UE4 version may be different from UE5.

---

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [January 23, 2023, 1:39pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/5 "2023-01-23T13:39:25Z")

</div>

Hi there,

Thank you both for the support, unfortunately there might be something else wrong, and I haven’t found any reference to this type of warning. Is there any way to force compiling even when warning occurs? It is not an error in the code.

I’ve started this project back in UE4, now with UE5.1, this warning may be occurring due to the recent updates in the API. I’ll keep searching, but at the moment, I have no idea what to do next.

Thank you again for the support.

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [January 23, 2023, 3:15pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/6 "2023-01-23T15:15:21Z")

</div>

Is your stuff wrapped in a #if block?  
Those are not properly supported by UHT.

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [January 23, 2023, 5:35pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/7 "2023-01-23T17:35:41Z")

</div>

The only thing that stop compilation is errors, it should compile with warnings.  
Could you post the whole file? And post your errors and warning log?

---

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [January 23, 2023, 6:19pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/8 "2023-01-23T18:19:01Z")

</div>

Hi, I’ve verified and there’s no #if blocks. I’ll keep searching through the documentation.  
Thank you.

---

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [January 23, 2023, 6:23pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/9 "2023-01-23T18:23:23Z")

</div>

Hi, unfortunately, I can’t post the whole code. That is the only warning occurring and this is the description:  
Severity Code Description File Line Column Suppression State  
Error MSB3073 The command ““C:\Program Files\Epic Games\UE\_5.1\Engine\Build\BatchFiles\Build.bat” Ambience510.Editor Win64 DebugGame -Project=“C:\Users\Public\Documents\StudyGuide\Ambience510\Ambience510.uproject” -WaitMutex -FromMsBuild” exited with code 6. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44 5

Thank you for the help.

---

<div class="post-metadata">

**Author:** ![Liquid0range](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/liquid0range/32/918300_2.png) [@Liquid0range](https://forums.unrealengine.com/u/Liquid0range)\
**Post date:** [June 15, 2023, 2:11am UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/10 "2023-06-15T02:11:04Z")

</div>

I’m a little late to the party, but hopefully it’s helpful to future troubleshooting!

I have received this error when I’ve made a typo further up in the file, such as forgetting a semi-colon in my forward declarations or after another class declaration.

I don’t think I have ever seen it for any other reason. Although I briefly thought I found an exception today, which is how I ended up on this thread 😆 but then after going back and checking more methodically, I really did just forget a semi-colon again.

---

<div class="post-metadata">

**Author:** ![Claude\_Dareau](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Claude\_Dareau](https://forums.unrealengine.com/u/Claude_Dareau)\
**Post date:** [July 10, 2023, 8:52pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/11 "2023-07-10T20:52:13Z")

</div>

fwiw I just ran into this when trying to define a USTRUCT within a namespace. So that seems to be another possibility.

---

<div class="post-metadata">

**Author:** ![FBogdanI](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FBogdanI](https://forums.unrealengine.com/u/FBogdanI)\
**Post date:** [September 15, 2023, 1:09pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/12 "2023-09-15T13:09:13Z")

</div>

I had this error and banged my head till i replaced the definition with another one that was working then typed the correct name. Seams there was an non displayable character there. check hexa of ur struct and see if u can spot it. Or rewrite it from scratch then replace the whole code area.

---

<div class="post-metadata">

**Author:** ![blurryroots](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blurryroots/32/490122_2.png) [@blurryroots](https://forums.unrealengine.com/u/blurryroots)\
**Post date:** [October 26, 2023, 7:28pm UTC](https://forums.unrealengine.com/t/structs-how-to-fix-warning-the-identifier-generated-ustruct-body-was-detected-in-a-block-being-skipped-was-this-intentional/755064/13 "2023-10-26T19:28:00Z")

</div>

Thanks, that did it for me. [This post](https://forums.unrealengine.com/t/does-ue-4-10-support-uclass-ustruct-in-namespaces/352448/7) highlights some of the reasoning why [UHT](https://docs.unrealengine.com/5.3/en-US/unreal-header-tool-for-unreal-engine/) does not support namespaces.
