public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108875] New: Possible wrong error message
@ 2023-02-21 19:13 jankowski938 at gmail dot com
2023-02-21 19:19 ` [Bug c/108875] " pinskia at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: jankowski938 at gmail dot com @ 2023-02-21 19:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108875
Bug ID: 108875
Summary: Possible wrong error message
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jankowski938 at gmail dot com
Target Milestone: ---
If the size of the integer differs from the function pointer size gcc emits
"error: initializer element is not constant". I think it is not the correct one
in this case.
Example code:
#define STACK_START 0x2000000
void reset_handler(void);
const uint64_t vector_table[] =
{
STACK_START,
(uint64_t)&reset_handler
};
void rest_handler(void)
{
}
It will compile for targets where inter type size is the same as the size of
the function pointer. Examples below:
godbolt.org/z/3cj97YzTd and godbolt.org/z/16YoK433r and godbolt.org/z/YoP9bx86a
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c/108875] Possible wrong error message
2023-02-21 19:13 [Bug c/108875] New: Possible wrong error message jankowski938 at gmail dot com
@ 2023-02-21 19:19 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-21 19:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108875
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 22020.
*** This bug has been marked as a duplicate of bug 22020 ***
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-21 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21 19:13 [Bug c/108875] New: Possible wrong error message jankowski938 at gmail dot com
2023-02-21 19:19 ` [Bug c/108875] " pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).