chilli framework error? // or me F ing up? \\it was neither XD

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Skyver
Posts: 12
Joined: September 26th, 2017, 12:35 pm
Location: Netherlands

chilli framework error? // or me F ing up? \\it was neither XD

Post by Skyver » May 3rd, 2019, 1:14 pm

hey yall

i have a little error in my poo game solution, solution link --> { https://github.com/SkyverNL/PooGame.git }
its not preventing me from moving on nor does it seem to break anything.
but its weird and the whole line is just unknown to me

the line ::
typedef struct DECLSPEC_ALIGN(16) DECLSPEC_NOINITALL _CONTEXT { ///

the error::
Severity Code Description Project File Line Suppression State
Error (active) E1097 unknown attribute "no_init_all" Engine C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h 3886

as a side note i had to re instal visual studio + updated to VS 2019 and f up with sdk that made me have a goose chase to finally re target the solution to the proper version
so maby its to do something with that idk would love to know tho.

much love Skyver ;)
Last edited by Skyver on May 4th, 2019, 10:20 am, edited 1 time in total.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: chilli framework error? // or me F ing up?

Post by albinopapa » May 3rd, 2019, 4:37 pm

Yeah, that version of the SDK has this bit of info:

//
// Anywhere that NOINITALL is defined, warning 4845 should be disabled. This warning
// fires whenever __declspec(no_init_all) is found but /d1initall isn't set. This isn't
// helpful since this will be done intentionally (not all components opt-in).
//
#if (_MSC_VER >= 1915)
#pragma warning(disable:4845) // __declspec(no_init_all) used but d1initall not set
#endif

#ifndef DECLSPEC_NOINITALL
#if (_MSC_VER >= 1915) && !defined(MIDL_PASS)
#define DECLSPEC_NOINITALL __declspec(no_init_all)
#else
#define DECLSPEC_NOINITALL
#endif
#endif

So it should fire any warnings or errors. While intellisense does put red squiggles under the usage, my project still compiles without failure. If yours won't, try downloading the previous SDK version (10.0.17763.0) and changing the properties to use it. That macro isn't defined in the previous version, so you should be good to go afterward.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Skyver
Posts: 12
Joined: September 26th, 2017, 12:35 pm
Location: Netherlands

Re: chilli framework error? // or me F ing up?

Post by Skyver » May 4th, 2019, 9:50 am

i didn't understand any of that information sorry :?

but it compiles and runs fine with it its just me being a perfectionist

buuuuuuuttt ;) ;) ;)

I FIXED IT :ugeek: :lol: :lol: :lol:

apparently it was due to a space in the line JUST AFTER "NOINTALL" :lol:

Code: Select all

before :: typedef struct DECLSPEC_ALIGN(16) DECLSPEC_NOINITALL _CONTEXT { ///  
                                                                                                    
after  :: typedef struct DECLSPEC_ALIGN(16) DECLSPEC_NOINITALL_CONTEXT { /// 

to save the change you gotta take full control permissions in the um folder tho

thanks for the help anyway


*mucho grando Albinopapa*

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: chilli framework error? // or me F ing up? \\it was neither XD

Post by albinopapa » May 4th, 2019, 5:20 pm

Code: Select all

typedef struct DECLSPEC_ALIGN(16) DECLSPEC_NOINITALL _CONTEXT { ... } CONTEXT, *PCONTEXT;
You messed it up. The name of the struct is suppose to be _CONTEXT.

typedef struct
This is a way of declaring a struct in C, it means: "I want a struct with the name _X and aliased to X"

DECLSPEC_ALIGN(16)
This macro is a memory alignment rule for the struct. Compilers use their own ways of getting hints on how to deal with code generation. GCC for instance uses __attribute__ and the Visual Studio compiler uses __declspec. The DECLSPEC_ALIGN( 16 ) macro is actually: __declspec( align( 16 ) ). It tells the compiler to align any instance of the following type to 16 byte boundaries: 0, 16, 32, ... Look up memory alignment to find out more.

DECLSPEC_NOINITALL
So, as mentioned, this one also defines a property of some sort, and the DECLSPEC_NOINITALL is defined as: __declspec( no_init_all ) and is a property of the struct _CONTEXT aliased with the name CONTEXT and a pointer of the type _CONTEXT aliased with the name PCONTEXT.

So, basically what you did is create a struct with memory alignment requirements of 16 bytes with the name DECLSPEC_NOINITALL_CONTEXT and aliased with CONTEXT and a pointer of the type aliased to PCONTEXT.

You should never have to change the SDK files.

Code: Select all

#pragma warning(disable:4845) // __declspec(no_init_all) used but d1initall not set
should have disabled any warnings or errors that would have been caused by the failure to set /d1initall as a compiler flag. If it is still giving warnings/errors then either the compiler has a bug or something has gone wrong with the installation.

When VS2017 first came out, I had an issue where the latest SDK version with certain compiler flags enabled would cause the windows imaging api to fail to be #include'd. Microsoft fixed it in a later SDK and now I can load images using the Windows Imaging API and have C++17 features enabled.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply