# FS\_Test::ID is not initialized properly

**URL:** <https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690>\
**Category:** Issues and Bug Reporting\
**Tags:** Struct, unreal-engine, bug-report, CPP, question\
**Created:** [May 19, 2022, 1:47am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690 "2022-05-19T01:47:11Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 19, 2022, 1:47am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/1 "2022-05-19T01:47:11Z")

</div>

Why do FGuids within c++ structs cause the error “FSomeStruct::SomeFGuid is not initialized properly.” in the following struct format?

```auto
USTRUCT(BlueprintType)
struct FS_Test : public FTableRowBase {
	GENERATED_BODY()

	UPROPERTY(BlueprintReadWrite, EditAnywhere)
		FGuid ID;

	// Initialize
	FS_Test() {
		ID = FGuid::NewGuid();
	}
	FS_Test(FGuid InID) {
		ID = InID;
		if (!ID.IsValid()) {
			ID = FGuid::NewGuid();
		}
	}

	// Operators
	bool operator==(const FS_Test& Other) const {
		return (
			ID == Other.ID
		);
	}
}

```

\*Edit so this is annoying, at first I thought the error appeared because the FGuid is set in the constructor, or maybe even because I use if / else, but after replacing the thing with an initialiser list the error remains. Am I missing something obvious?

```auto
USTRUCT(BlueprintType)
struct FS_SomeStruct : public FTableRowBase {
	GENERATED_BODY()

	UPROPERTY(BlueprintReadWrite, EditAnywhere)
		FGuid ID;

	// Initialize
	FS_SomeStruct()
		: ID (FGuid())
	{
	}
	FS_SomeStruct(FGuid InID) 
		: ID (InID)
	{
		if (!ID.IsValid()) {
			ID = FGuid::NewGuid();
		}
	}

	// Operators
	bool operator==(const FS_SomeStruct& Other) const {
		return (
			ID == Other.ID
		);
	}
};

```

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 20, 2022, 2:17am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/2 "2022-05-20T02:17:35Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 20, 2022, 6:49pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/3 "2022-05-20T18:49:09Z")

</div>

Bump . If this is the correct way to do it, that would also be an answer. I think UE might just be acting weird on USTRUCT ? I have 3 structs where this happens and one where it doesn’t, using nearly the same implementation. The only difference being that the working UPROPERTY is marked (BlueprintReadOnly, VisibleAnywhere) while the non working ones are marked (BlueprintReadWrite, EditAnywhere). That would be strange wouldn’t it…

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [May 21, 2022, 9:24am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/4 "2022-05-21T09:24:07Z")

</div>

My guess here is that the FGuid default constructor does nothing, in which case it’ll be uninitialized memory. You may need to use an explicit initializer constructor for your default constructor.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 21, 2022, 7:34pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/5 "2022-05-21T19:34:30Z")

</div>

But it does?

Runtime\Core\Public\Misc\Guid.h

```auto
struct FGuid
{
public:

	/** Default constructor. */
	FGuid()
		: A(0)
		, B(0)
		, C(0)
		, D(0)
	{ }

	explicit FGuid(uint32 InA, uint32 InB, uint32 InC, uint32 InD)
		: A(InA), B(InB), C(InC), D(InD)
	{ }

	explicit FGuid(const FString& InGuidStr)
	{
		if (!Parse(InGuidStr, *this))
		{
			Invalidate();
		}
	}

....

```

\*Edit I used to initialize using NewGuid, but that gave the same result.

```auto
FGuid FGuid::NewGuid()
{
	FGuid Result(0, 0, 0, 0);
	FPlatformMisc::CreateGuid(Result);

	return Result;
}

```

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [May 22, 2022, 5:16pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/6 "2022-05-22T17:16:36Z")

</div>

Okay this actually explains it. The problem is that FGuid actually has _two_ declarations - one in the header you mentioned, the other in NoExportTypes.h

The warning about uninitialized struct members comes from the Unreal Header Tool, and UHT parses the duplicate FGuid from NoExportTypes.h which has no initialization or constructors.

So really it’s an oversight from Epic. You can ignore the warning, since in actual C++ code the native FGuid will be used. The stub in NoExportTypes just generates the required reflection data to expose that type to Blueprint. There isn’t a workaround for this AFAIK.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 22, 2022, 6:39pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/7 "2022-05-22T18:39:50Z")

</div>

Is it possible that certain UPROPERTY specifiers alter this behavior? It’s odd that this problem occurs in a few (but not all) structs with FGuid where the only difference are the specifiers and meta. I also see other data types in the NoExportTypes.h like FTransform but none of these generate the message. Why is that?

\*Edit, forgot to note that the error is not a visual studio one but a log entry in UE.

---

<div class="post-metadata">

**Author:** ![zosiu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zosiu/32/547113_2.png) [@zosiu](https://forums.unrealengine.com/u/zosiu)\
**Post date:** [July 4, 2022, 5:14pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/8 "2022-07-04T17:14:23Z")

</div>

There’s a meta tag you can use: `IgnoreForMemberInitializationTest`.

`Engine\Source\Runtime\CoreUObject\Public\UObject\ObjectMacros.h`:

```auto
/// [PropertyMetadata] Used for bypassing property initialization tests when the property cannot be safely tested in a deterministic fashion. Example: random numbers, guids, etc.
		IgnoreForMemberInitializationTest,

```

# Example usage:

`UnrealEngine\Engine\Plugins\Runtime\ZoneGraph\Source\ZoneGraph\Public\ZoneGraphTypes.h`:

```auto
	UPROPERTY(meta = (IgnoreForMemberInitializationTest))
	FGuid ID;

```

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [July 5, 2022, 7:44pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/9 "2022-07-05T19:44:22Z")

</div>

Thank you, but what does this mean? What initialization tests? How does this apply to an FGuid?

```auto
when the property cannot be safely tested in a deterministic fashion

```

---

<div class="post-metadata">

**Author:** ![zosiu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zosiu/32/547113_2.png) [@zosiu](https://forums.unrealengine.com/u/zosiu)\
**Post date:** [July 7, 2022, 1:13am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/10 "2022-07-07T01:13:51Z")

</div>

If you are interested in how the check is done, take a look at `FindUninitializedScriptStructMembers` in `Runtime\CoreUObject\Private\UObject\Class.cpp`.

Basically it’s looking for uninitialized struct members to warn you about (undefined behavior is not fun).  
At a glance, it seems like struct properties are checked by seeing if the given property will have the same value for 2 different variables. This just won’t work with things that are non-deterministic by design; random numbers, uids (if you make 2 uids, you want them to be different, otherwise it wouldn’t be very useful for identifying things), and the like… the test will just fail in case the property is initialized properly. For these cases you can use the meta tag to skip the check.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [July 8, 2022, 4:10pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/11 "2022-07-08T16:10:38Z")

</div>

Thanks, I will check this. I was surprised to find many FGuid properties which do not generate the warning and these few which do. I have no clue why.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [July 23, 2022, 1:56pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/12 "2022-07-23T13:56:30Z")

</div>

Related…

> [@Properties disappear from datatable editor view when categories are modified](https://forums.unrealengine.com/t/datatable-no-longer-shows-70-of-the-struct/612438):
>
> When opening the datatable, the row type displays as “S\_SomeStruct S\_SomeStruct” (twice!). Properties have been added with categories, of which only one category shows in the row editor. I tried: Data can still be exported and reimported , JSON is complete. Cleared all derived data cache (appdata / project / engine) Cleaned the entire project, rebuilt with VS. Created a new datatable with the same struct, same result. Added a new property of the missing category, still not showing up. UPROP…

“Not initialized properly” warning now showing on any type even booleans if a struct / datatable bugs somehow. All affected properties are within datatables.

---

<div class="post-metadata">

**Author:** ![wulcat](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wulcat/32/88714_2.png) [@wulcat](https://forums.unrealengine.com/u/wulcat)\
**Post date:** [October 20, 2022, 9:27am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/13 "2022-10-20T09:27:07Z")

</div>

Did you find a solution to this problem, its happening for while packaging.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [October 26, 2022, 9:46am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/14 "2022-10-26T09:46:56Z")

</div>

No I didn’t. It appears that it doesn’t pop up for all but very specific properties and when it does it keeps going on. Something must be broken in the engine.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [December 29, 2022, 12:20pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/16 "2022-12-29T12:20:57Z")

</div>

No solution, but for anyone reading I tried creating a new clean project and migrating the affected structs, datatables and their dependencies to a new module with no success. Looking at the view count on this post it’s quite a common issue.

---

<div class="post-metadata">

**Author:** ![isopropanol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@isopropanol](https://forums.unrealengine.com/u/isopropanol)\
**Post date:** [January 29, 2023, 4:20am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/17 "2023-01-29T04:20:44Z")

</div>

The error “is not initialized properly” essentially means “give me an initial value”. This applies only to structs, I believe. You can assign it on the declaration line or in a constructor function.  
For example,  
FGuid ID = FGuid(0,0,0,0);

Although you do assign it NewGuid() in the constructor. Maybe it’s seeing that as still uninitialized. A lot of times the default constructor in the docs will indicate that it is uninitialized.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [January 29, 2023, 5:40am UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/18 "2023-01-29T05:40:14Z")

</div>

Thanks for the suggestion but this has already been tested in both the constructor and by initializing the GUID in the initializer list.

---

<div class="post-metadata">

**Author:** ![TylerRsT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TylerRsT](https://forums.unrealengine.com/u/TylerRsT)\
**Post date:** [December 23, 2024, 2:39pm UTC](https://forums.unrealengine.com/t/fs-test-id-is-not-initialized-properly/560690/19 "2024-12-23T14:39:54Z")

</div>

Hi there,

For those who are still looking solutions for this issue:  
Add #include “Misc/Guid.h” in your file and you won’t see the error anymore 🙂
