Re: -fdefault-integer-8 in c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El día 10 de marzo de 2010 15:54, John (Eljay) Love-Jensen
<eljay@xxxxxxxxx> escribió:
> Hi José,
>
>> Would be possible to use something like #define int long in the code.
>
> That would be possible.  (Along the same lines as "It would be possible to kill a fly using a 12 PW orbital satellite laser.")
>
> I strongly discourage such a solution.
>
> From a C (or C++) point of view, such a solution would be "very bad".  I would rank it in the top ten worst coding practices for C/C++, were such to be used.
>
> I am rather biased against programming in the Preprocessor in general.  This would be a particularly odious use of the Preprocessor programming.
>
> Even moreso because you'd need to do it in your header file, and all your clients would be affected by the Preprocessor substitution of a C/C++ keyword.  Very likely including the OS header files, which would break the platform API.
>
> Sincerely,
> --Eljay
>

OK, I see.
I have been seen some cblas implementations in order to imitate the
behaviour in my code.

In cblas implementation from GSL and ATLAS, all indexes is defined as
int in cblas.h, as the cblas standard says. But in GotoBLAS2 the
indexes of the functions in cblas.h are defines as blasint type, that
is defined in common.h as:

#if defined(OS_WINDOWS) && defined(__64BIT__)
typedef long long BLASLONG;
typedef unsigned long long BLASULONG;
#else
typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif

#ifdef USE64BITINT
typedef BLASLONG blasint;
#else
typedef int blasint;
#endif

As you said me in your first reply, one way is via typedef, that would
be probably the way that I will implement in my code.

-fdefault-integer-8 in C probably make the things easier in this case,
but ISO C standard says (if I remember correctly) that int must have a
maximum of 4 bytes length.

-- 
*****************************************
José Luis García Pallero
jgpallero@xxxxxxxxx
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux