IDE やプロファイラまでついてくるフリー最強の C++ コンパイラ
Watcom C++ について語りませう。
一応、こちらから入手できます。
難点はちょっと大きい事(45MB)です。
http://www.openwatcom.org/
探検
OpenWatcom C++
■ このスレッドは過去ログ倉庫に格納されています
1デフォルトの名無しさん
NGNG729デフォルトの名無しさん
2012/08/25(土) 17:37:17.84 Watcomerなら #pragma で埋め込んでください。
730デフォルトの名無しさん
2012/09/03(月) 16:59:04.15 こうして
#pragma pack(4)
struct __m128 {
float m128_f32[4];
};
こうやって
extern "C" __m128 _mm_add_ps(__m128 &a, __m128 &b);
こうやると
#pragma aux _mm_add_ps = \
".686 " \
".XMM " \
"movaps xmm0,[eax] " \
"movaps xmm1,[edx]" \
"addps xmm0,xmm1" \
"movaps [esi],xmm0" \
parm [eax] [edx]
…movapsでこけるな
とりあえずmovups使うとして、アライメントの調整どうするんだ?
#pragma pack(4)
struct __m128 {
float m128_f32[4];
};
こうやって
extern "C" __m128 _mm_add_ps(__m128 &a, __m128 &b);
こうやると
#pragma aux _mm_add_ps = \
".686 " \
".XMM " \
"movaps xmm0,[eax] " \
"movaps xmm1,[edx]" \
"addps xmm0,xmm1" \
"movaps [esi],xmm0" \
parm [eax] [edx]
…movapsでこけるな
とりあえずmovups使うとして、アライメントの調整どうするんだ?
731730
2012/09/03(月) 19:51:42.43 コンパイラに用意されてないっぽいから適当にやるか
732730
2012/09/04(火) 16:39:10.83 #pragma pack(16)
ってやったら通った
けど微妙に気持ち悪いな
ってやったら通った
けど微妙に気持ち悪いな
733デフォルトの名無しさん
2012/09/04(火) 22:22:55.40 unsigned char *p1 = malloc( sizeof(struct __m128) + 15);
unsigned char *p2 = malloc( sizeof(struct __m128) + 15);
struct __m128 *x1 = p1 & 0xfffffff0;
struct __m128 *x2 = p2 & 0xfffffff0;
_mm_add_ps( &x1,&x2 );
free( p1 );
free( p2 );
unsigned char *p2 = malloc( sizeof(struct __m128) + 15);
struct __m128 *x1 = p1 & 0xfffffff0;
struct __m128 *x2 = p2 & 0xfffffff0;
_mm_add_ps( &x1,&x2 );
free( p1 );
free( p2 );
734733
2012/09/04(火) 22:26:06.39 引数に渡すとこ間違えた。&いらんか。
735デフォルトの名無しさん
2012/10/08(月) 16:55:46.38 インスコミスったくさい
736デフォルトの名無しさん
2012/10/08(月) 23:51:19.90 がんばってくさい
737デフォルトの名無しさん
2012/10/17(水) 00:47:21.13 ばあさんや、2.0はまだかのう?
738デフォルトの名無しさん
2012/10/19(金) 00:48:04.10 じいさん、さっき1.9がでたばっかりじゃろ
739デフォルトの名無しさん
2012/12/06(木) 12:41:58.34 bad_allocクラスがあるんだから投げてくれてもいいのになあ
740デフォルトの名無しさん
2012/12/20(木) 16:28:37.35 C99にあるけど未実装の数学関数をfortranのライブラリから適当に持ってくる場当たりハック
741デフォルトの名無しさん
2013/01/16(水) 19:16:26.12 stringのoperator<<とoperator>>まだー?
742デフォルトの名無しさん
2013/01/17(木) 06:47:05.24 // wcl386 whattime.cpp
#define FILE_NAME "whattime.txt"
#include <fstream.h>
#include <iomanip.h>
#include <strstrea.h>
#include <string.hpp>
#include <time.h>
int main()
{
ostrstream os;
strstreambuf *b = os.rdbuf();
time_t timer = time(NULL);
struct tm *p = localtime(&timer);
os << " " << setfill('0') << setw(2) << p->tm_hour;
os << ":" << setfill('0') << setw(2) << p->tm_min;
os << ":" << setfill('0') << setw(2) << p->tm_sec << ends;
String hours_minutes_seconds( os.str() );
b->freeze(0);
ofstream file;
file.open(FILE_NAME, ios::app);
file << hours_minutes_seconds;
file.close();
return 0;
}
/*
whattime
type whattime.txt
*/
#define FILE_NAME "whattime.txt"
#include <fstream.h>
#include <iomanip.h>
#include <strstrea.h>
#include <string.hpp>
#include <time.h>
int main()
{
ostrstream os;
strstreambuf *b = os.rdbuf();
time_t timer = time(NULL);
struct tm *p = localtime(&timer);
os << " " << setfill('0') << setw(2) << p->tm_hour;
os << ":" << setfill('0') << setw(2) << p->tm_min;
os << ":" << setfill('0') << setw(2) << p->tm_sec << ends;
String hours_minutes_seconds( os.str() );
b->freeze(0);
ofstream file;
file.open(FILE_NAME, ios::app);
file << hours_minutes_seconds;
file.close();
return 0;
}
/*
whattime
type whattime.txt
*/
743デフォルトの名無しさん
2013/01/17(木) 06:49:45.39 C:\work>whattime
C:\work>type whattime.txt
06:48:35
C:\work>whattime
C:\work>type whattime.txt
06:48:35 06:48:56
C:\work>whattime
C:\work>whattime
C:\work>whattime
C:\work>type whattime.txt
06:48:35 06:48:56 06:49:04 06:49:06 06:49:11
C:\work>
C:\work>type whattime.txt
06:48:35
C:\work>whattime
C:\work>type whattime.txt
06:48:35 06:48:56
C:\work>whattime
C:\work>whattime
C:\work>whattime
C:\work>type whattime.txt
06:48:35 06:48:56 06:49:04 06:49:06 06:49:11
C:\work>
744デフォルトの名無しさん
2013/01/24(木) 13:56:44.17 みんな喜べ
色々用意ができれば今年の終わりに2.0出せるかもってよ
ソースはニュースグループ
色々用意ができれば今年の終わりに2.0出せるかもってよ
ソースはニュースグループ
745デフォルトの名無しさん
2013/01/24(木) 21:28:38.05 2.0で何か変わるの?
746デフォルトの名無しさん
2013/01/24(木) 22:52:43.36 Windows8対応
747デフォルトの名無しさん
2013/02/10(日) 17:44:30.57 Digital Mars C/C++ Compiler Version 8.56 がひっそりと出てる
ttp://www.digitalmars.com/download/freecompiler.html
ttp://www.digitalmars.com/download/freecompiler.html
748デフォルトの名無しさん
2013/02/10(日) 18:42:19.32 いつの間にかDigital MarsのスレがDAT落ちしてる…
749デフォルトの名無しさん
2013/02/11(月) 12:36:53.03 去年大量糞スレ立て荒らしがあった
例の件の証拠隠滅と思われ
例の件の証拠隠滅と思われ
750デフォルトの名無しさん
2013/02/26(火) 12:40:21.12 nanを比較してtrueが帰ってきてちょっとあせったけど
そもそもC++98だとnanの比較が未定義だったぜ
そもそもC++98だとnanの比較が未定義だったぜ
751デフォルトの名無しさん
2013/03/12(火) 18:31:42.20 sgiのSTLの最新版がrope以外殆んどそのまま使えそうな予感
エラーでたところのtypename消してコンフィグいじったらコンパイル通った
エラーでたところのtypename消してコンフィグいじったらコンパイル通った
752デフォルトの名無しさん
2013/05/24(金) 23:50:53.13 stlport 5.2.1 for dmc,Open Watcom
ttp://www.6809.net/tenk/?%E9%9B%91%E8%A8%98%2f2013-05-20
ttp://www.6809.net/tenk/?%E9%9B%91%E8%A8%98%2f2013-05-20
753デフォルトの名無しさん
2013/07/26(金) NY:AN:NY.AN /*
wcl386 nonnum.cpp
nonnum 5
nonnum -
nonnum ^
*/
#include <iostream.h>
#include <string.hpp>
int main(int argc, char *argv[])
{
String line("0123456789");
const int line_length = line.length();
if(argc != 2) return 1;
int b = line.index(argv[1]); // nonnum 5
if(b != NPOS) {
cout << argv[1] << " can be found." << endl;
} else {
String non_number(argv[1]);
if(non_number == "-") {
b = line_length;
} else {
b = 0;
}
}
String lead = line(0, b);
String trail = line(b, line_length);
cout << trail << endl; // "56789"
return 0;
}
wcl386 nonnum.cpp
nonnum 5
nonnum -
nonnum ^
*/
#include <iostream.h>
#include <string.hpp>
int main(int argc, char *argv[])
{
String line("0123456789");
const int line_length = line.length();
if(argc != 2) return 1;
int b = line.index(argv[1]); // nonnum 5
if(b != NPOS) {
cout << argv[1] << " can be found." << endl;
} else {
String non_number(argv[1]);
if(non_number == "-") {
b = line_length;
} else {
b = 0;
}
}
String lead = line(0, b);
String trail = line(b, line_length);
cout << trail << endl; // "56789"
return 0;
}
754デフォルトの名無しさん
2013/07/26(金) NY:AN:NY.AN nonnum "^"
755デフォルトの名無しさん
2013/10/05(土) 18:40:23.90 確信
756デフォルトの名無しさん
2013/10/17(木) 18:22:02.26 エディタでソースの日本語表示ってフォントを変えれば出来るんだな、つかフォントの変え方が独特すぎる
757デフォルトの名無しさん
2013/10/21(月) 23:27:02.65 #include <iostream>
class StaticInteger {
int data;
int *pointer;
public:
StaticInteger(int *p, int d) {
pointer = p;
data = d;
}
int acquire() const { return data; }
void revise(int *p, int d) {
if(p == pointer) data = d;
}
} *static_integer;
void function() {
using namespace std;
cout << static_integer->acquire() << endl;
}
static int static_int;
int main(void) {
StaticInteger si(&static_int, 2345);
static_integer = &si;
function();
static_integer->revise(&static_int, 8765);
function();
return 0;
}
class StaticInteger {
int data;
int *pointer;
public:
StaticInteger(int *p, int d) {
pointer = p;
data = d;
}
int acquire() const { return data; }
void revise(int *p, int d) {
if(p == pointer) data = d;
}
} *static_integer;
void function() {
using namespace std;
cout << static_integer->acquire() << endl;
}
static int static_int;
int main(void) {
StaticInteger si(&static_int, 2345);
static_integer = &si;
function();
static_integer->revise(&static_int, 8765);
function();
return 0;
}
758デフォルトの名無しさん
2013/11/29(金) 10:53:13.80 2.0まだ〜?
759デフォルトの名無しさん
2013/12/16(月) 11:34:12.96760デフォルトの名無しさん
2013/12/17(火) 23:31:20.81 ファイル名 2.0 だけど正式releaseじゃなくてデイリービルドなのか?
少し試してみたけど1.9 とほとんど変わってなさそうだった。
ヘッダみるとインデントや名前の付け替えは多いけど肝心の修正は少なそうだし
少し試してみたけど1.9 とほとんど変わってなさそうだった。
ヘッダみるとインデントや名前の付け替えは多いけど肝心の修正は少なそうだし
761デフォルトの名無しさん
2014/01/25(土) 12:55:02.01 stubがへんな日本語になのだが、英語にする方法教えて
環境は Windows XPで、wcl Version 1.8
>これは an OS/2 16-bit 実行可能 です
環境は Windows XPで、wcl Version 1.8
>これは an OS/2 16-bit 実行可能 です
762デフォルトの名無しさん
2014/01/28(火) 21:09:37.48 SET WLANG=english
763デフォルトの名無しさん
2014/01/29(水) 13:52:17.88 見栄えがよくなったよ
ありがとん
>This is an OS/2 16-bit executable
ありがとん
>This is an OS/2 16-bit executable
764デフォルトの名無しさん
2014/02/12(水) 23:45:17.25 誰か新ネタくれよ
765 【だん吉】
2014/03/01(土) 00:41:09.57 これとVS2010のC++とどっちがいいかな
766デフォルトの名無しさん
2014/03/09(日) 09:54:14.45 std::forward_listきたか
767デフォルトの名無しさん
2014/03/21(金) 15:40:46.17ID:HlK5TI/j プロファイラのつかいかた
例でおしえてください
おねがいします
コマンドツールでもプロファイラつかえますか?
わからんわからん
例でおしえてください
おねがいします
コマンドツールでもプロファイラつかえますか?
わからんわからん
768デフォルトの名無しさん
2014/03/22(土) 17:19:23.68ID:4HmosEXO769デフォルトの名無しさん
2014/04/03(木) 04:15:15.90ID:DqBt0M+X #include <iostream.h>
#include <string.h>
#include <string.hpp>
void display(String & s)
{
cout << "length = " << s.length() << endl;
int u = strcspn( s.c_str(), "0123456789"); // Error!
cout << "u = " << u << endl;
}
// つづく
#include <string.h>
#include <string.hpp>
void display(String & s)
{
cout << "length = " << s.length() << endl;
int u = strcspn( s.c_str(), "0123456789"); // Error!
cout << "u = " << u << endl;
}
// つづく
770デフォルトの名無しさん
2014/04/03(木) 04:16:13.95ID:DqBt0M+X int main(int argc, char *argv[])
{
const int COUNT = 4096;
String id("bcd10023");
int id_length = id.length();
switch(argc) {
case 2:
if(! strcmp(argv[1], "-e") ) { // Errorになるオプション
String s = id(id_length, COUNT);
display(s);
} else {
display(id);
}
break;
default:
display(id);
break;
}
return 0;
}
{
const int COUNT = 4096;
String id("bcd10023");
int id_length = id.length();
switch(argc) {
case 2:
if(! strcmp(argv[1], "-e") ) { // Errorになるオプション
String s = id(id_length, COUNT);
display(s);
} else {
display(id);
}
break;
default:
display(id);
break;
}
return 0;
}
771デフォルトの名無しさん
2014/04/03(木) 04:18:00.77ID:DqBt0M+X C:\work>cspan
length = 8
u = 3
C:\work>cspan -e
length = 0
The instruction at 0x00401412 referenced memory at 0x00000000.
The memory could not be read.
C:\work>cspan -s
length = 8
u = 3
length = 8
u = 3
C:\work>cspan -e
length = 0
The instruction at 0x00401412 referenced memory at 0x00000000.
The memory could not be read.
C:\work>cspan -s
length = 8
u = 3
772デフォルトの名無しさん
2014/04/03(木) 05:02:24.33ID:8q69jo+f > String s = id(id_length, COUNT);
なにこれ
C:\WATCOM\docs\cpplib.pdf
にも書いてないけど
なにこれ
C:\WATCOM\docs\cpplib.pdf
にも書いてないけど
773デフォルトの名無しさん
2014/04/03(木) 05:27:06.37ID:DqBt0M+X 部分文字列です
sub-sequenceは、posからはじまって、len個つづきます
The sub-sequence begins at offset pos within the String object and continues for len characters.
String::operator ()()
Synopsis: #include <string.hpp>
public:
String String::operator ()( size_t pos, size_t len ) const;
Semantics: This form of the operator () public member function extracts a sub-sequence of characters from
the String object. A new String object is created that contains the sub-sequence of characters.
The sub-sequence begins at offset pos within the String object and continues for len characters. The
first character of a String object is at position zero.
If pos is greater than or equal to the length of the String object, the result is empty.
If len is such that pos + len exceeds the length of the object, the result is the sub-sequence of characters
from the String object starting at offset pos and running to the end of the String object.
Results: The operator () public member function returns a String object.
See Also: String::operator [], operator char, operator char const *
String Class 873
cpplib.pdf
sub-sequenceは、posからはじまって、len個つづきます
The sub-sequence begins at offset pos within the String object and continues for len characters.
String::operator ()()
Synopsis: #include <string.hpp>
public:
String String::operator ()( size_t pos, size_t len ) const;
Semantics: This form of the operator () public member function extracts a sub-sequence of characters from
the String object. A new String object is created that contains the sub-sequence of characters.
The sub-sequence begins at offset pos within the String object and continues for len characters. The
first character of a String object is at position zero.
If pos is greater than or equal to the length of the String object, the result is empty.
If len is such that pos + len exceeds the length of the object, the result is the sub-sequence of characters
from the String object starting at offset pos and running to the end of the String object.
Results: The operator () public member function returns a String object.
See Also: String::operator [], operator char, operator char const *
String Class 873
cpplib.pdf
774デフォルトの名無しさん
2014/04/03(木) 05:31:01.56ID:DqBt0M+X // substri.cpp
#include <iostream.h>
#include <string.hpp>
int main(int argc, char *argv[])
{
const int COUNT = 4096;
String id("bcd10023");
int id_length = id.length();
String s = id(id_length, COUNT);
cout << "s: length = " << s.length() << endl;
cout << s << endl;
int count = 3;
int begin = 3;
String g = id(begin, count);
cout << "g: length = " << g.length() << endl;
cout << g << endl;
return 0;
}
/*
C:\work>substri
s: length = 0
g: length = 3
100
*/
#include <iostream.h>
#include <string.hpp>
int main(int argc, char *argv[])
{
const int COUNT = 4096;
String id("bcd10023");
int id_length = id.length();
String s = id(id_length, COUNT);
cout << "s: length = " << s.length() << endl;
cout << s << endl;
int count = 3;
int begin = 3;
String g = id(begin, count);
cout << "g: length = " << g.length() << endl;
cout << g << endl;
return 0;
}
/*
C:\work>substri
s: length = 0
g: length = 3
100
*/
775デフォルトの名無しさん
2014/05/25(日) 16:37:45.33ID:Rj36S/n2 追加されそうにないし暇つぶしに書いた
大体動く
namespace std{
inline istream& operator>>(istream is, string& str)
{
if(!is.good())return is;
str.erase();
string::size_type sz = is.width();
if(sz==0)sz=str.max_size();
std::cout << is.width() << std::endl;
char c;
is.get(c);
for(string::size_type i=0; !isspace(c) && !is.eof() && (i < sz);i++){
str += c;
is.get(c);
}
is.width(0);
return is;
};
inline ostream& operator<<(ostream os,const string str)
{
if(!os.good())return os;
os.write(str.data(),str.size());
return os;
};
}
大体動く
namespace std{
inline istream& operator>>(istream is, string& str)
{
if(!is.good())return is;
str.erase();
string::size_type sz = is.width();
if(sz==0)sz=str.max_size();
std::cout << is.width() << std::endl;
char c;
is.get(c);
for(string::size_type i=0; !isspace(c) && !is.eof() && (i < sz);i++){
str += c;
is.get(c);
}
is.width(0);
return is;
};
inline ostream& operator<<(ostream os,const string str)
{
if(!os.good())return os;
os.write(str.data(),str.size());
return os;
};
}
776デフォルトの名無しさん
2014/06/09(月) 23:57:18.89ID:dAVEHAsk windows 7,64bitを使っているのですが,
wclでコンパイルした実行ファイルは,64bitでは使えない
というメッセージがでるのですが,wcl386でコンパイルする
と実行できるのです。
wclとwcl386とではどう違うのでしょうか。
wclでコンパイルした実行ファイルは,64bitでは使えない
というメッセージがでるのですが,wcl386でコンパイルする
と実行できるのです。
wclとwcl386とではどう違うのでしょうか。
777デフォルトの名無しさん
2014/06/10(火) 01:06:02.23ID:kNmgHm7N wcl は 16bit CPU 環境用の exe を生成。
wcl386 は 32bit CPU 環境用の exe 生成。
32bit windows は 16/32 bit(cpu) exe を実行できるけど、
64bit windows は 32/64bit exe のみで 16bit exeを実行できない。
wcl386 は 32bit CPU 環境用の exe 生成。
32bit windows は 16/32 bit(cpu) exe を実行できるけど、
64bit windows は 32/64bit exe のみで 16bit exeを実行できない。
778デフォルトの名無しさん
2014/06/10(火) 05:40:57.55ID:ZIPkO3Cr >777
了解しました。
ありがとうございます。
了解しました。
ありがとうございます。
779デフォルトの名無しさん
2014/08/03(日) 12:09:22.65ID:91Gs3y/1 ★2ch勢いランキングサイトリスト★
◎ +ニュース
・ 2NN
・ 2chTimes
◎ +ニュース新着
・ 2NN新着
・ Headline BBY
◎ +ニュース他
・ Desktop2ch
・ 記者別一覧
◎ 全板
・ 全板縦断勢いランキング
・ スレッドランキング総合ランキング
◎ 実況込み
・ 2勢
・ READ2CH
・ i-ikioi
※ 要サイト名検索
◎ +ニュース
・ 2NN
・ 2chTimes
◎ +ニュース新着
・ 2NN新着
・ Headline BBY
◎ +ニュース他
・ Desktop2ch
・ 記者別一覧
◎ 全板
・ 全板縦断勢いランキング
・ スレッドランキング総合ランキング
◎ 実況込み
・ 2勢
・ READ2CH
・ i-ikioi
※ 要サイト名検索
■ このスレッドは過去ログ倉庫に格納されています
ニュース
- 731部隊の新資料、中国が公開 「日本が細菌戦の罪を自白」と主張 ロシアが引き渡し [少考さん★]
- 【速報】「女芸人No.1決定戦 THE W」9代目女王にニッチェ! 7年ぶり3度目で悲願の優勝 [牛丼★]
- 【芸能】『女芸人No.1決定戦THE W』 粗品が最後にバッサリ「優勝賞金1000万円にしてはレベル低い大会」 [冬月記者★]
- 「おこめ券は米以外の食品も買える。効果的な活用を」 地元で農水相 [山形県] [少考さん★]
- 中国・ロシア両軍の爆撃機が東京方面へ向かう「異例のルート」を共同飛行…核も搭載可能、連携して威嚇か ★8 [ぐれ★]
- 【広島】ペルー女性の国保加入を誤って認め、福山市が医療費484万円を肩代わりするミス…入院して手術を受ける [ぐれ★]
- 首都高料金値上げへ 上限1950円撤廃も視野 維持費などコスト10年で1.4倍に急増で [737440712]
- 【緊急高市朗報】WBC全試合、地上波完全生放送決定wmwmwmwmwmwmwmwmwmwmwmwmwmwmwmw [517459952]
- 【実況】博衣こよりのえちえちダンガンロンパ4🧪
- 【高市速報】ダウンジャケット(カナダグース)おじさん、大量発生😲!!!!!!!!!!!!!! [862423712]
- 🏡パン🍞つー✌まる👌見え👊😅👊
- 千晴!😡
