GCC language extension __attribute__((vector_size(16))) incompatible type error











up vote
0
down vote

favorite












While using Csmith a random C program generator I tried adding a GNU C language variable extension attribute((vector_size(16))) for variable .



static uint64_t  func_1(void)
{/* block id: 0 */
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
int32_t *l_7 /*__attribute__ ((vector_size (16)))*/ = (void*)0;
int32_t *l_8 /*__attribute__ ((vector_size (16)))*/= &g_9;
int32_t *l_10 = &g_5.f7;
int32_t **l_11[10][8][3] = {{{&l_10,&l_10,&l_10},{&l_7,&l_8,&l_8},{&l_8,&l_8,(void*)0},{&l_7,&l_8,&l_10},{&l_8,&l_7,&l_10},{&l_8$
int32_t *l_13 = &g_9;
int i, j, k;
(*l_8) |= (g_2[3] , (safe_rshift_func_int16_t_s_s(0L, (g_5 , (l_6 != g_5.f2)))));
(*l_10) |= ((g_12 = l_10) != (void*)0);
l_13 = &g_9;
return (*l_13);

}


where as there are #define's provided for int8_t(like signed char),int16_t(like short) and so on.
and safe_rshift_func_int16_t_s_s is a function internally defined.



compiling the above program with gcc gives following errors:



sam.c: In function ‘func_1’:
sam.c:53:56: error: incompatible types when initializing type ‘__vector(8) long long unsigned int’ using type ‘long long unsigned int’
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
^~~~~~~~~~~~~~~~~~~~


Is the attribute wrongly placed?
I tried referring to the documentation from the GCC portal linked here but unable to understand exactly the correct use of this attribute, please can anyone point them out?



Are there any restrictions so as where to use this attribute?
Thanks community. !:)



I tried searching SO and web but most of them talk about use typedef for their solutions.










share|improve this question






















  • What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
    – nemequ
    Nov 20 at 3:05










  • It's a random fuzzer of C language generation
    – Sameeran Joshi
    Nov 20 at 5:45















up vote
0
down vote

favorite












While using Csmith a random C program generator I tried adding a GNU C language variable extension attribute((vector_size(16))) for variable .



static uint64_t  func_1(void)
{/* block id: 0 */
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
int32_t *l_7 /*__attribute__ ((vector_size (16)))*/ = (void*)0;
int32_t *l_8 /*__attribute__ ((vector_size (16)))*/= &g_9;
int32_t *l_10 = &g_5.f7;
int32_t **l_11[10][8][3] = {{{&l_10,&l_10,&l_10},{&l_7,&l_8,&l_8},{&l_8,&l_8,(void*)0},{&l_7,&l_8,&l_10},{&l_8,&l_7,&l_10},{&l_8$
int32_t *l_13 = &g_9;
int i, j, k;
(*l_8) |= (g_2[3] , (safe_rshift_func_int16_t_s_s(0L, (g_5 , (l_6 != g_5.f2)))));
(*l_10) |= ((g_12 = l_10) != (void*)0);
l_13 = &g_9;
return (*l_13);

}


where as there are #define's provided for int8_t(like signed char),int16_t(like short) and so on.
and safe_rshift_func_int16_t_s_s is a function internally defined.



compiling the above program with gcc gives following errors:



sam.c: In function ‘func_1’:
sam.c:53:56: error: incompatible types when initializing type ‘__vector(8) long long unsigned int’ using type ‘long long unsigned int’
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
^~~~~~~~~~~~~~~~~~~~


Is the attribute wrongly placed?
I tried referring to the documentation from the GCC portal linked here but unable to understand exactly the correct use of this attribute, please can anyone point them out?



Are there any restrictions so as where to use this attribute?
Thanks community. !:)



I tried searching SO and web but most of them talk about use typedef for their solutions.










share|improve this question






















  • What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
    – nemequ
    Nov 20 at 3:05










  • It's a random fuzzer of C language generation
    – Sameeran Joshi
    Nov 20 at 5:45













up vote
0
down vote

favorite









up vote
0
down vote

favorite











While using Csmith a random C program generator I tried adding a GNU C language variable extension attribute((vector_size(16))) for variable .



static uint64_t  func_1(void)
{/* block id: 0 */
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
int32_t *l_7 /*__attribute__ ((vector_size (16)))*/ = (void*)0;
int32_t *l_8 /*__attribute__ ((vector_size (16)))*/= &g_9;
int32_t *l_10 = &g_5.f7;
int32_t **l_11[10][8][3] = {{{&l_10,&l_10,&l_10},{&l_7,&l_8,&l_8},{&l_8,&l_8,(void*)0},{&l_7,&l_8,&l_10},{&l_8,&l_7,&l_10},{&l_8$
int32_t *l_13 = &g_9;
int i, j, k;
(*l_8) |= (g_2[3] , (safe_rshift_func_int16_t_s_s(0L, (g_5 , (l_6 != g_5.f2)))));
(*l_10) |= ((g_12 = l_10) != (void*)0);
l_13 = &g_9;
return (*l_13);

}


where as there are #define's provided for int8_t(like signed char),int16_t(like short) and so on.
and safe_rshift_func_int16_t_s_s is a function internally defined.



compiling the above program with gcc gives following errors:



sam.c: In function ‘func_1’:
sam.c:53:56: error: incompatible types when initializing type ‘__vector(8) long long unsigned int’ using type ‘long long unsigned int’
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
^~~~~~~~~~~~~~~~~~~~


Is the attribute wrongly placed?
I tried referring to the documentation from the GCC portal linked here but unable to understand exactly the correct use of this attribute, please can anyone point them out?



Are there any restrictions so as where to use this attribute?
Thanks community. !:)



I tried searching SO and web but most of them talk about use typedef for their solutions.










share|improve this question













While using Csmith a random C program generator I tried adding a GNU C language variable extension attribute((vector_size(16))) for variable .



static uint64_t  func_1(void)
{/* block id: 0 */
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
int32_t *l_7 /*__attribute__ ((vector_size (16)))*/ = (void*)0;
int32_t *l_8 /*__attribute__ ((vector_size (16)))*/= &g_9;
int32_t *l_10 = &g_5.f7;
int32_t **l_11[10][8][3] = {{{&l_10,&l_10,&l_10},{&l_7,&l_8,&l_8},{&l_8,&l_8,(void*)0},{&l_7,&l_8,&l_10},{&l_8,&l_7,&l_10},{&l_8$
int32_t *l_13 = &g_9;
int i, j, k;
(*l_8) |= (g_2[3] , (safe_rshift_func_int16_t_s_s(0L, (g_5 , (l_6 != g_5.f2)))));
(*l_10) |= ((g_12 = l_10) != (void*)0);
l_13 = &g_9;
return (*l_13);

}


where as there are #define's provided for int8_t(like signed char),int16_t(like short) and so on.
and safe_rshift_func_int16_t_s_s is a function internally defined.



compiling the above program with gcc gives following errors:



sam.c: In function ‘func_1’:
sam.c:53:56: error: incompatible types when initializing type ‘__vector(8) long long unsigned int’ using type ‘long long unsigned int’
uint64_t l_6 __attribute__ ((vector_size (64))) = 0xCD2466E9F08664A1LL;
^~~~~~~~~~~~~~~~~~~~


Is the attribute wrongly placed?
I tried referring to the documentation from the GCC portal linked here but unable to understand exactly the correct use of this attribute, please can anyone point them out?



Are there any restrictions so as where to use this attribute?
Thanks community. !:)



I tried searching SO and web but most of them talk about use typedef for their solutions.







c gcc compiler-errors gcc-extensions






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 at 18:54









Sameeran Joshi

32




32












  • What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
    – nemequ
    Nov 20 at 3:05










  • It's a random fuzzer of C language generation
    – Sameeran Joshi
    Nov 20 at 5:45


















  • What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
    – nemequ
    Nov 20 at 3:05










  • It's a random fuzzer of C language generation
    – Sameeran Joshi
    Nov 20 at 5:45
















What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
– nemequ
Nov 20 at 3:05




What are you trying to do? Set all elements of the vector to 0xCD2466E9F08664A1LL?
– nemequ
Nov 20 at 3:05












It's a random fuzzer of C language generation
– Sameeran Joshi
Nov 20 at 5:45




It's a random fuzzer of C language generation
– Sameeran Joshi
Nov 20 at 5:45

















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',
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%2f53380964%2fgcc-language-extension-attribute-vector-size16-incompatible-type-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f53380964%2fgcc-language-extension-attribute-vector-size16-incompatible-type-error%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

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'