也许这是一个糟糕的编程案例,但它体现在 XLC++ 从 6.0 升级到 11.1
代码如下所示:
int startAt = 140;
startAt = parseAndSaveResponseINSTANTID_MODEL(response, startAt);
COUT << "After tokenize INSTANTID_MODEL startAt=" <<startAt <<ENDL;
startAt = startAt++;
startAt = parseAndSaveResponseINSTANTID_CHRON_HISTORY(response, startAt);
COUT << "After tokenize INSTANTID_MODEL startAt=" <<startAt <<ENDL;
startAt = startAt++;
startAt = parseAndSaveResponseINSTANTID_FOLLOWUP_ACTION(response, startAt);
COUT << "After tokenize TSTID_INSTANTID_FOLLOWUP_ACTION startAt=" <<startAt <<ENDL;
startAt = startAt++;
startAt = parseAndSaveResponseINSTANTID_RISK_INDICATOR(response, startAt);
COUT << "After tokenize TSTID_INSTANTID_RISK_INDICATOR startAt=" <<startAt <<ENDL;
在每个解析方法中,我们做一个return (startAt + 1 + vRows * 81);
vRows 在所有方法中都为零。
使用旧编译器,输出如下所示:
After tokenize INSTANTID_MODEL startAt=141
vRows=0
After tokenize INSTANTID_MODEL startAt=142
vRows=0
After tokenize TSTID_INSTANTID_FOLLOWUP_ACTION startAt=143
vRows=0
After tokenize TSTID_INSTANTID_RISK_INDICATOR startAt=144
但是,使用新的编译器,输出看起来像
After tokenize INSTANTID_MODEL startAt=141
vRows=0
After tokenize INSTANTID_MODEL startAt=143
vRows=0
After tokenize TSTID_INSTANTID_FOLLOWUP_ACTION startAt=145
vRows=0
After tokenize TSTID_INSTANTID_RISK_INDICATOR startAt=147
处理整数/返回的方式是否发生了变化?