This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH rsa/stdint_noheaders] Cleanup: Add #include <stdint.h> for uint[32|64]_t usage (except installed headers)
- From: Ryan S Arnold <rsa at linux dot vnet dot ibm dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 05 Jun 2013 12:36:19 -0500
- Subject: Re: [PATCH rsa/stdint_noheaders] Cleanup: Add #include <stdint.h> for uint[32|64]_t usage (except installed headers)
- References: <1367425419 dot 9067 dot 281 dot camel at localhost dot localdomain> <20130516133649 dot GA11396 at domone dot kolej dot mff dot cuni dot cz> <CAAKybw8EP358UABnY2crSGVJxC7R_U-19t95XY0Fw+Cdd9GWwA at mail dot gmail dot com> <CAAKybw-iGGtV9E8tfBmX1Wv_fEq-rrir2pHx8=2gPbNDrKrtOQ at mail dot gmail dot com> <87ppwdo7ho dot fsf at kepler dot schwinge dot homeip dot net> <CAAKybw9dFBbefktz=Ph7afcBZQJ8fH+VwCiWP_pUfKejHFKQ8w at mail dot gmail dot com> <CAAKybw-ose53Km2JKPF96Tr7R0o36F6BpVRr-vpuC1pc0j-pNw at mail dot gmail dot com> <51AE0C0B dot 2080001 at redhat dot com>
On Tue, 2013-06-04 at 11:47 -0400, Carlos O'Donell wrote:
> On 06/04/2013 11:44 AM, Ryan S. Arnold wrote:
> > On Thu, May 30, 2013 at 12:23 PM, Ryan S. Arnold <ryan.arnold@gmail.com> wrote:
> >> On Sun, May 26, 2013 at 2:40 PM, Thomas Schwinge
> >> <thomas@codesourcery.com> wrote:
> >>>>>> On Wed, May 01, 2013 at 11:23:39AM -0500, Ryan Arnold wrote:
> >>>>>>> Per Roland's suggestion in "[PATCH rsa/stdint] Cleanup: Add #include
> >>>>>>> <stdint.h> for uint[32|64]_t usage" I have removed the installed headers
> >>>>>>> from this patch, and separated the ChangeLog entries into the proper
> >>>>>>> subdirectory ChangeLogs.
> >>>
> >>>> Pushed upstream:
> >>>>
> >>>> commit e054f494306530720114b321b3d97ca2f397cbbb
> >>>> Author: Ryan S. Arnold <rsa@linux.vnet.ibm.com>
> >>>> Date: Wed May 1 10:46:34 2013 -0500
> >>>>
> >>>> Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).
> >>>
> >>> I'm seeing:
> >>>
> >>> make[2]: Entering directory `[...]/locale'
> >>> /usr/bin/perl gen-translit.pl < C-translit.h.in > C-translit.h.tmp
> >>> mv -f C-translit.h.tmp C-translit.h
> >>>
> >>> ..., resulting in:
> >>>
> >>> diff --git locale/C-translit.h locale/C-translit.h
> >>> index 98f66e2..d7ec778 100644
> >>> --- locale/C-translit.h
> >>> +++ locale/C-translit.h
> >>> @@ -1,5 +1,3 @@
> >>> -#include <stdint.h>
> >>> -
> >>> #define NTRANSLIT 1355
> >>> static const uint32_t translit_from_idx[] =
> >>> {
> >>>
> >>> Should a) the change be reverted for this file (that is, the above hunk
> >>> be applied), or b) the generator be changed to emit that #include, or,
> >>> heck, c) the autogenerated file be removed from the source repository
> >>> (and then some)?
> >>
> >>
> >>
> >> Siddhesh pointed out to me that I should have modified the perl script
> >> which is used to generate this file, rather than the generated file.
> >>
> >> I'll do that shortly.
> >
> > Considering that C-translit.h is generated, whose responsibility is it
> > to make sure the generated version is pushed into the source tree?
> >
> > Should I make the change to gen-translit.pl as well as C-translit.h
> > and commit both? Or should I just make the change to gen-translit.pl
> > and let someone else check in the generated C-translit.h later?
> >
> > I suppose Thomas's question still stands. Should the autogenerated
> > file be removed from the source repository?
>
> It's your responsibility to update the generator, generate the file,
> and check both in. We shouldn't need to force everyone to regenerate
> files on their target system, it would really complicate the build
> process.
>
> Feel free to argue differently though.
Nope, I'm fine with this.
I regenerated and pushed a fix as:
commit 869378a5bf1d415f52c14d9697b886d8143a73e1
Author: Ryan S. Arnold <rsa@linux.vnet.ibm.com>
Date: Wed Jun 5 10:28:33 2013 -0500
Add #include <stdint.h> to locale/gen-translit.pl and fix C-translit.h.
ChangeLog
2013-06-05 Ryan S. Arnold <rsa@linux.vnet.ibm.com>
* locale/C-translit.h: Revert #include <stdint.h> because this is a
generated file. Regenerate properly from gen-translit.pl.
* locale/gen-translit.pl: Add #include <stdint.h>. This generates
locale/C-translit.h.
diff --git a/locale/C-translit.h b/locale/C-translit.h
index 98f66e2..fdd4450 100644
--- a/locale/C-translit.h
+++ b/locale/C-translit.h
@@ -1,5 +1,4 @@
#include <stdint.h>
-
#define NTRANSLIT 1355
static const uint32_t translit_from_idx[] =
{
diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl
index d44310b..5f30e30 100644
--- a/locale/gen-translit.pl
+++ b/locale/gen-translit.pl
@@ -53,6 +53,8 @@ while (<F>) {
}
}
+printf "#include <stdint.h>\n";
+
printf "#define NTRANSLIT %d\n", $#froms + 1;
printf "static const uint32_t translit_from_idx[] =\n{\n ";