mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2015-09-25, 21:33   #1
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default GNU specific macros

Is there a GNU specific macro named MAYBE_UNUSED?

It seems to be an attribute specification. The CWI code is replete with it
and Visual Studio does not recognize it. Nor is it #defined anywhere/
R.D. Silverman is offline   Reply With Quote
Old 2015-09-25, 21:46   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Is there a GNU specific macro named MAYBE_UNUSED?

It seems to be an attribute specification. The CWI code is replete with it
and Visual Studio does not recognize it. Nor is it #defined anywhere/
googling ( like people are always told on these forums) "MAYBE_UNUSED" brings up:


Quote:
Originally Posted by http://lists.denx.de/pipermail/u-boot/2014-July/183494.html
When static inline is used in a header file the function
should preferably be inlined and if not possible made a
static function. When declared inside a c file there is a
static function, which might be inlined. Since SPL uses a
define to declare the static inline it becomes part of the
c file although it is declared in a header and clang will
warn that you have introduced unused static functions. Add
maybe_unused to prevent such warnings.
adding a +GNU mostly brings up text of codes.
science_man_88 is offline   Reply With Quote
Old 2015-09-25, 22:09   #3
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

11101001001002 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
googling ( like people are always told on these forums) "MAYBE_UNUSED" brings up:




adding a +GNU mostly brings up text of codes.
I DID google. It was the first thing that I did. But there was no mention of it being specific to GNU.

Note also that the compile is CASE SENSITIVE. MAYBE_UNUSED (upper case) is not the same
to a compiler as maybe_used (lower case).

One can also find a definition as __attribute__((unused)) which isn't helpful, since VS does not recognize
__attribute__

Last fiddled with by R.D. Silverman on 2015-09-25 at 22:12
R.D. Silverman is offline   Reply With Quote
Old 2015-09-25, 22:13   #4
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Is there a GNU specific macro named MAYBE_UNUSED?

It seems to be an attribute specification. The CWI code is replete with it
and Visual Studio does not recognize it. Nor is it #defined anywhere/
Adding to my problems. The CWI code is filled with a data type lprime_t.

But I will be DAMNED if I can find its definition as a data type anywhere in the code.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-25, 22:18   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I DID google. It was the first thing that I did. But there was no mention of it being specific to GNU.

Note also that the compile is CASE SENSITIVE. MAYBE_UNUSED (upper case) is not the same
to a compiler as maybe_used (lower case).

One can also find a definition as __attribute__((unused)) which isn't helpful, since VS does not recognize
__attribute__
even though I quoted it google gave me back results that didn't respect case and maybe that's part of the problem the compiler's having with it all because "lprime_t"

brings up IPrime_t on google.

edit: http://www.unixwiz.net/techtips/gnu-c-attributes.html suggest that the attribute one was designed to be compatible with non GNU
Quote:
It was designed in a way to be compatible with non-GNU implementations,
though I guess it could be compatible with both sets non-GNU and GNU.

edit2: http://stackoverflow.com/questions/1...tribute-packed says at least for c++ that visual c++ has no equivalent and only has "#pragma pack(1)"

Last fiddled with by science_man_88 on 2015-09-25 at 22:36
science_man_88 is offline   Reply With Quote
Old 2015-09-25, 23:29   #6
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

746010 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Adding to my problems. The CWI code is filled with a data type lprime_t.

But I will be DAMNED if I can find its definition as a data type anywhere in the code.
Further aggravation. I was able to compile and link some code using VS2013
that failed to compile under VS2010. The problem is that the latter fails to recognize c99.
(The CWI is full of such constructions).

OK. I then transferred the executable from the system where it was compiled (at work
because I don't want to pay $4,000 to get VS2013 for my home PC) to my home PC.

The code was compiled as x64 code. But the move involves going from Win 7 to Win 8.

Short story: the code will not run; It first reported a missing MS run time dll. (msvcr120.dll)
I installed this. It still does not run. Instead, I get a NOTORIOUS windows error code:

0xc000007b

The cause can come from many places. I suspect it is a 32/64 bit incompatibility problem.

Tracking down the problem will be tedious......
R.D. Silverman is offline   Reply With Quote
Old 2015-09-25, 23:41   #7
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

1045410 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Tracking down the problem will be tedious......
Life is hard. Consider the alternatives....
chalsall is offline   Reply With Quote
Old 2015-09-26, 01:23   #8
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

5×709 Posts
Default

MAYBE_UNUSED in GMP-ECM is a define that becomes the gcc intrinsic '__attribute__((unused))' and is attached to variables that (duh) are unused; the attribute avoids a compiler warning. Defining it to be empty is harmless.

Did you actually install the complete redistributable pack for the version of MSVC you were using, or just the one runtime library?

Bob, I know you've spent a lot of time on this already, but the CWI suite is abandonware; you are literally the only one doing anything with it and it sounds like it's holding you back.

Last fiddled with by jasonp on 2015-09-26 at 01:31
jasonp is offline   Reply With Quote
Old 2015-09-26, 05:57   #9
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by jasonp View Post
MAYBE_UNUSED in GMP-ECM is a define that becomes the gcc intrinsic '__attribute__((unused))' and is attached to variables that (duh) are unused; the attribute avoids a compiler warning. Defining it to be empty is harmless.

Did you actually install the complete redistributable pack for the version of MSVC you were using, or just the one runtime library?

Bob, I know you've spent a lot of time on this already, but the CWI suite is abandonware; you are literally the only one doing anything with it and it sounds like it's holding you back.
I have my own filter code. Adapted from code written for QS. It was written 25 years ago. In f77. It uses
an old, and inefficient method (structured Gaussian elim). I don't have a compiler for it.

I have my own LA code; a very crude and slow implementation of BL.

I have my own sqrt code. It is a very slow, brute force method (multiply everything using FFT's) then take the
square root by Newton's method. It also requires knowing generators for the fundamental units; I have even
older code that requires knowing generators for all the ideals --- yech.

I have my own efficient siever. It is very efficient. It emits relations in CWI format. I therefore use the much more effective
CWI post-processing tools. Having my own siever allows me to tinker with it and to try new things.

I don't want to switch to msieve/GGNFS; I'd lose my siever.

I might switch my siever to emit msieve style relations, then use msieve, but it is a large learning curve
to learn how to compile, build, and use msieve. Will it even compile under Windows VS?

I can't install any network based software (e.g. cygwin or ming or similar) at work. I can build CWI code
at home using ming, as long as I don't turn on the optimizer......... And the un-optimized code is SLOW.

I don't want to use a pre-built msieve -- I have an intense dislike of black box code.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-26, 06:09   #10
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

164448 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I have my own filter code. Adapted from code written for QS. It was written 25 years ago. In f77. It uses
an old, and inefficient method (structured Gaussian elim). I don't have a compiler for it.

I have my own LA code; a very crude and slow implementation of BL.

I have my own sqrt code. It is a very slow, brute force method (multiply everything using FFT's) then take the
square root by Newton's method. It also requires knowing generators for the fundamental units; I have even
older code that requires knowing generators for all the ideals --- yech.

I have my own efficient siever. It is very efficient. It emits relations in CWI format. I therefore use the much more effective
CWI post-processing tools. Having my own siever allows me to tinker with it and to try new things.

I don't want to switch to msieve/GGNFS; I'd lose my siever.

I might switch my siever to emit msieve style relations, then use msieve, but it is a large learning curve
to learn how to compile, build, and use msieve. Will it even compile under Windows VS?

I can't install any network based software (e.g. cygwin or ming or similar) at work. I can build CWI code
at home using ming, as long as I don't turn on the optimizer......... And the un-optimized code is SLOW.

I don't want to use a pre-built msieve -- I have an intense dislike of black box code.
I did get the buildmatrix code built under ming. But the CWI LA code will not compile. It uses a datatype(s)
'lprime_t' , lprime_tc that is not defined ANYWHERE. It gives a bunch of warnings that are ignorable.

Last fiddled with by R.D. Silverman on 2015-09-26 at 06:16
R.D. Silverman is offline   Reply With Quote
Old 2015-09-26, 06:59   #11
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I did get the buildmatrix code built under ming. But the CWI LA code will not compile. It uses a datatype(s)
'lprime_t' , lprime_tc that is not defined ANYWHERE. It gives a bunch of warnings that are ignorable.
I HAVE built a 64-bit version of the CWI LA code under VS using a 2003 source version.


I'm not sure if it is reliable.....
R.D. Silverman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of nvcc compiler macros? ewmayer GPU Computing 8 2013-10-13 00:46
macros in nasm tichy Programming 1 2011-03-06 16:24
How do I test a specific 2^p-1? Alex Information & Answers 1 2011-01-12 22:46
Specific core faulty? Rhyotion Hardware 6 2008-09-18 06:06
Is it possible to reserve a specific n-value for 2^n-1? jasong PrimeNet 1 2006-09-21 00:10

All times are UTC. The time now is 17:45.


Tue May 24 17:45:24 UTC 2022 up 40 days, 15:46, 0 users, load averages: 1.90, 1.67, 1.79

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔