Bug 1366830 - int8_t/int16_t/int64_t is 32 bits
Summary: int8_t/int16_t/int64_t is 32 bits
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 24
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-13 08:41 UTC by Changming Sun
Modified: 2017-07-27 11:06 UTC (History)
11 users (show)

Fixed In Version: glibc-2.22-18.fc23, glibc-2.23.1-10.fc24, glibc-2.24-3.fc25, glibc-2.24.90-4.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-27 11:06:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 647084 0 None None None 2016-08-13 15:14:56 UTC
Sourceware 16907 0 None None None 2016-08-13 15:14:40 UTC

Description Changming Sun 2016-08-13 08:41:56 UTC
Description of problem:
Sometimes, int64_t is 32 bits.

Version-Release number of selected component (if applicable):
Fedora 24,glibc-2.23,gcc-6.1.1-3

How reproducible:
$ cat a.cpp
#include <argp.h>

#include <sys/types.h>
#include <stdio.h>


int main(int argc, char* argv[]) {
  printf("sizeof(int64_t)=%d\n",(int)sizeof(int64_t));
  printf("sizeof(long)=%d\n",(int)sizeof(long));
  return 0;
}


$ g++ -o a -std=c++11 a.cpp
$ ./a

Actual results:
sizeof(int64_t)=4
sizeof(long)=8

Expected results:
sizeof(int64_t)=8
sizeof(long)=8

Additional info:
If you change -std=c++11 to -std=gnu++11 or -std=gnu++98 or any gnu else, the result is correct.  That's because argp.h undefined gcc's __attribute__ keyword.

#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
  defined __STRICT_ANSI__
#  define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
  defined __STRICT_ANSI__
#  define __format__ format
#  define __printf__ printf
# endif
#endif

And sys/types.h doesn't check if "__attribute__" works
#if !__GNUC_PREREQ (2, 7)
...
#else
/* For GCC 2.7 and later, we can use specific type-size attributes.  */
# define __intN_t(N, MODE) \
  typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
# define __u_intN_t(N, MODE) \
  typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
#endif

Comment 1 Fedora Update System 2016-08-18 14:56:25 UTC
glibc-2.24-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-57cba655d5

Comment 2 Fedora Update System 2016-08-18 15:17:24 UTC
glibc-2.23.1-10.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-5f050a0a6d

Comment 3 Fedora Update System 2016-08-18 16:53:43 UTC
glibc-2.24-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-57cba655d5

Comment 4 Fedora Update System 2016-08-18 17:32:36 UTC
glibc-2.22-18.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-87dde780b8

Comment 5 Fedora Update System 2016-08-19 00:21:42 UTC
glibc-2.22-18.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-87dde780b8

Comment 6 Fedora Update System 2016-08-19 00:58:48 UTC
glibc-2.23.1-10.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5f050a0a6d

Comment 7 Fedora Update System 2016-08-19 19:52:48 UTC
glibc-2.23.1-10.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2016-08-27 10:22:47 UTC
glibc-2.24-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2016-09-02 23:20:35 UTC
glibc-2.22-18.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora End Of Life 2017-07-25 22:25:09 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.


Note You need to log in before you can comment on or make changes to this bug.