Alignment for types with fixed bit length on QNXHow do you set, clear, and toggle a single bit?What are POD types in C++?What is an undefined reference/unresolved external symbol error and how do I fix it?typedef - Primitive type to primitive typeReplacing a 32-bit loop counter with 64-bit introduces crazy performance deviationsHow to dump all the predefined symbols?__attribute__ packed of an integerPassing std::string as parameter gives error - htons functionImplication of GCC warning: ignoring attributes on template argument (-Wignored-attributes)Why scanf is not taking any input and giving Error in hackerearth editor and codeblocks

The cat ate your input again!

Sentience, killing, & extremes?

Generate Brainfuck for the numbers 1–255

MinionPro is erroneous

Is it okay for a ticket seller to grab a tip in the USA?

How would I as a DM create a smart phone-like spell/device my players could use?

Is TA-ing worth the opportunity cost?

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

In SQL Server, why does backward scan of clustered index cannot use parallelism?

Withdrew when Jimmy met up with Heath

Ordering a word list

How does this kind of structure made?

Can I call myself an assistant professor without a PhD?

Why should we care about syntactic proofs if we can show semantically that statements are true?

Three legged NOT gate? What is this symbol?

Dropdowns & Chevrons for Right to Left languages

What gave Harry Potter the idea of writing in Tom Riddle's diary?

Identification of vintage sloping window

What is the maximum number of PC-controlled undead?

How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?

Why are Gatwick's runways too close together?

Why isn’t SHA-3 in wider use?

Ex-contractor published company source code and secrets online



Alignment for types with fixed bit length on QNX


How do you set, clear, and toggle a single bit?What are POD types in C++?What is an undefined reference/unresolved external symbol error and how do I fix it?typedef - Primitive type to primitive typeReplacing a 32-bit loop counter with 64-bit introduces crazy performance deviationsHow to dump all the predefined symbols?__attribute__ packed of an integerPassing std::string as parameter gives error - htons functionImplication of GCC warning: ignoring attributes on template argument (-Wignored-attributes)Why scanf is not taking any input and giving Error in hackerearth editor and codeblocks






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















On Windows uint16_t is just a typedef of unsigned short (from VS2017 stdint.h):



typedef unsigned short uint16_t;


But on QNX6 with GCC uint16_t from stdint.h refers to _Uint16t:



typedef _Uint16t uint16_t;


which is declared in includesyscompiler_gnu.h as following:



typedef unsigned int _GCC_ATTR_ALIGN_u16t __attribute__((__mode__(__HI__)));
typedef _GCC_ATTR_ALIGN_u16t _Uint16t __attribute__((__aligned__(2)));


What's the reason to make uint16_t aligned in that case?



The question is came from the code below:



 using T = uint16_t;
std::map<T, unsigned char> m;


Which gives me a warning:




warning: ignoring attributes on template argument 'T aka short unsigned int' 
[-Wignored-attributes]



Should I switch back to using T = unsigned short; to prevent such a warning?










share|improve this question
























  • What version of QNX are you using? What is the gcc version?

    – Red.Wave
    Mar 28 at 13:01











  • @Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

    – αλεχολυτ
    Mar 28 at 13:09











  • Can you remove the "-Wignored-attributes" switch from compile options?

    – Red.Wave
    Mar 28 at 14:02











  • @Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

    – αλεχολυτ
    Mar 29 at 12:27











  • A realtime OS with a claim on speed.

    – Red.Wave
    Mar 29 at 13:55

















0















On Windows uint16_t is just a typedef of unsigned short (from VS2017 stdint.h):



typedef unsigned short uint16_t;


But on QNX6 with GCC uint16_t from stdint.h refers to _Uint16t:



typedef _Uint16t uint16_t;


which is declared in includesyscompiler_gnu.h as following:



typedef unsigned int _GCC_ATTR_ALIGN_u16t __attribute__((__mode__(__HI__)));
typedef _GCC_ATTR_ALIGN_u16t _Uint16t __attribute__((__aligned__(2)));


What's the reason to make uint16_t aligned in that case?



The question is came from the code below:



 using T = uint16_t;
std::map<T, unsigned char> m;


Which gives me a warning:




warning: ignoring attributes on template argument 'T aka short unsigned int' 
[-Wignored-attributes]



Should I switch back to using T = unsigned short; to prevent such a warning?










share|improve this question
























  • What version of QNX are you using? What is the gcc version?

    – Red.Wave
    Mar 28 at 13:01











  • @Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

    – αλεχολυτ
    Mar 28 at 13:09











  • Can you remove the "-Wignored-attributes" switch from compile options?

    – Red.Wave
    Mar 28 at 14:02











  • @Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

    – αλεχολυτ
    Mar 29 at 12:27











  • A realtime OS with a claim on speed.

    – Red.Wave
    Mar 29 at 13:55













0












0








0








On Windows uint16_t is just a typedef of unsigned short (from VS2017 stdint.h):



typedef unsigned short uint16_t;


But on QNX6 with GCC uint16_t from stdint.h refers to _Uint16t:



typedef _Uint16t uint16_t;


which is declared in includesyscompiler_gnu.h as following:



typedef unsigned int _GCC_ATTR_ALIGN_u16t __attribute__((__mode__(__HI__)));
typedef _GCC_ATTR_ALIGN_u16t _Uint16t __attribute__((__aligned__(2)));


What's the reason to make uint16_t aligned in that case?



The question is came from the code below:



 using T = uint16_t;
std::map<T, unsigned char> m;


Which gives me a warning:




warning: ignoring attributes on template argument 'T aka short unsigned int' 
[-Wignored-attributes]



Should I switch back to using T = unsigned short; to prevent such a warning?










share|improve this question














On Windows uint16_t is just a typedef of unsigned short (from VS2017 stdint.h):



typedef unsigned short uint16_t;


But on QNX6 with GCC uint16_t from stdint.h refers to _Uint16t:



typedef _Uint16t uint16_t;


which is declared in includesyscompiler_gnu.h as following:



typedef unsigned int _GCC_ATTR_ALIGN_u16t __attribute__((__mode__(__HI__)));
typedef _GCC_ATTR_ALIGN_u16t _Uint16t __attribute__((__aligned__(2)));


What's the reason to make uint16_t aligned in that case?



The question is came from the code below:



 using T = uint16_t;
std::map<T, unsigned char> m;


Which gives me a warning:




warning: ignoring attributes on template argument 'T aka short unsigned int' 
[-Wignored-attributes]



Should I switch back to using T = unsigned short; to prevent such a warning?







c++ gnu memory-alignment qnx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 8:23









αλεχολυταλεχολυτ

2,0741 gold badge17 silver badges51 bronze badges




2,0741 gold badge17 silver badges51 bronze badges















  • What version of QNX are you using? What is the gcc version?

    – Red.Wave
    Mar 28 at 13:01











  • @Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

    – αλεχολυτ
    Mar 28 at 13:09











  • Can you remove the "-Wignored-attributes" switch from compile options?

    – Red.Wave
    Mar 28 at 14:02











  • @Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

    – αλεχολυτ
    Mar 29 at 12:27











  • A realtime OS with a claim on speed.

    – Red.Wave
    Mar 29 at 13:55

















  • What version of QNX are you using? What is the gcc version?

    – Red.Wave
    Mar 28 at 13:01











  • @Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

    – αλεχολυτ
    Mar 28 at 13:09











  • Can you remove the "-Wignored-attributes" switch from compile options?

    – Red.Wave
    Mar 28 at 14:02











  • @Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

    – αλεχολυτ
    Mar 29 at 12:27











  • A realtime OS with a claim on speed.

    – Red.Wave
    Mar 29 at 13:55
















What version of QNX are you using? What is the gcc version?

– Red.Wave
Mar 28 at 13:01





What version of QNX are you using? What is the gcc version?

– Red.Wave
Mar 28 at 13:01













@Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

– αλεχολυτ
Mar 28 at 13:09





@Red.Wave I cross-compile application on Windows via gcc 5.5 for QNX6.5

– αλεχολυτ
Mar 28 at 13:09













Can you remove the "-Wignored-attributes" switch from compile options?

– Red.Wave
Mar 28 at 14:02





Can you remove the "-Wignored-attributes" switch from compile options?

– Red.Wave
Mar 28 at 14:02













@Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

– αλεχολυτ
Mar 29 at 12:27





@Red.Wave sure, but I don't see a reason to do so. I would like to know why uint16_t is aligned on QNX.

– αλεχολυτ
Mar 29 at 12:27













A realtime OS with a claim on speed.

– Red.Wave
Mar 29 at 13:55





A realtime OS with a claim on speed.

– Red.Wave
Mar 29 at 13:55












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372639%2falignment-for-types-with-fixed-bit-length-on-qnx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372639%2falignment-for-types-with-fixed-bit-length-on-qnx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴