EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Any Large Integer Libraries Out There for the ARM?

Started by David T. Ashley April 18, 2012
David T. Ashley wrote:

> Noob wrote: > >> AFAIR, gcc supports restrict even in (non-pedantic) C89 mode. > > Could you define "pedantic" in this usage? > > I looked up the word in a dictionary and also looked at compiler > options, and the meaning of the word really isn't making sense to me. > > What is "pedantic"?
I was referring to GCC's "-pedantic" option. cf. http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-pedantic-252 Regards.
Christopher Head wrote:
> On Thu, 26 Apr 2012 22:59:09 +0200 > Hans-Bernhard Br&#4294967295;ker <HBBroeker@t-online.de> wrote: > >> I'm afraid you're overlooking the aliasing issue. Just because >> _your_ function doesn't modify those values doesn't mean they won't >> change mid-stride, which could actually _require_ the function to >> keep reading the original value through the pointer. >> >> E.g. what do you think would happen if I did something (admittedly) >> crazy equivalent to >> >> uint32_t mynum[10]; >> mul_32_96(/*in32*/mynum + i, /*in96*/ mynum + 1, /*out*/mynum); > > Doesn't the C strict aliasing rule make this unspecified behaviour? > Pointers to different types neither of which are > (signed|unsigned|blank) char and which aren't related by one being an > element of the other are assumed not to alias.
He didn't provide the prototype of mul_32_96, but given the function call, one could assume void mul_32_96(uint32_t *in32, uint32_t *in96, uint32_t *mynum); where aliasing could indeed happen.
On Fri, 27 Apr 2012 16:41:52 +0200
Noob <root@127.0.0.1> wrote:

> He didn't provide the prototype of mul_32_96, but given the > function call, one could assume > > void mul_32_96(uint32_t *in32, uint32_t *in96, uint32_t *mynum); > > where aliasing could indeed happen.
In that case it could. I assumed in96 was some kind of 96-bit-long type, probably a struct. If they're all uint32_t pointers, then of course they could alias. Chris
On Fri, 27 Apr 2012 16:22:06 +0200, David Brown
<david@westcontrol.removethisbit.com> wrote:
> >"Pedantic" means "particularly fussy or detailed". With gcc, using >"pedantic" means that the compiler will be much stricter about >supporting the standards, and /only/ the standards. For example, >"restrict" and "inline" are keywords in later C standards, but were not >available in earlier ones. gcc likes to give you more features than the >standards demand, so that you can use these features when compiling in >C89 mode. But to allow for people who happened to have a function >called "restrict" and a typedef called "inline", which is legal in C89 >but not C99, you can compile in "pedantic" mode. (You can still access >newer features as "__restrict__" or "__inline__" for example.) >"pedantic" mode is also useful for checking strict standards >compatibility to aid portability of code.
Thanks, now I understand. Using www.dictionary.com, I got this: 1. ostentatious in one's learning. 2. overly concerned with minute details or formalisms, especially in teaching. The definition you provided is (I think) #2, and it wasn't clicking for me by just reading the dictionary definition and the documentation of the compiler parameter. DTA

The 2024 Embedded Online Conference