#1458 : Parentheses Matching

本文介绍了一种针对平衡括号字符串进行匹配的算法实现。通过输入由'('和')'组成的平衡括号字符串,该算法能够输出每一对匹配括号在字符串中的位置。示例展示了如何对输入(())()()进行处理并得到对应括号的位置信息。

描述

Given a string of balanced parentheses output all the matching pairs.

输入

A string consisting of only parentheses '(' and ')'. The parentheses are balanced and the length of the string is no more than 100000.

输出

For each pair of matched parentheses output their positions in the string.

样例输入
(())()()
样例输出
1 4  
2 3  
5 6  
7 8

一般括号匹配的变形,错了一发,要把所有情况想清楚再写。


代码:

#include <bits/stdc++.h>

using namespace std;
const int maxn=110000;
int a[maxn],b[maxn];
int d[maxn];
int v[maxn];
int main()
{
    char c[maxn];
    scanf("%s",c);
    int l=strlen(c);
    int ans1=0,ans2=0;
    int tem=0;
    for(int i=0;i<l;i++)
    {
        if(c[i]=='(')
        {
            a[ans1++]=i+1;
            tem=ans1-1;
        }
        else
        {
            b[ans2++]=i+1;
            while(v[tem])
            {
                tem--;
            }
            d[tem--]=ans2-1;
            v[tem+1]=1;
        }
    }
    for(int i=0;i<ans1;i++)
    {
        printf("%d %d\n",a[i],b[d[i]]);
    }
    return 0;
}


n file included from /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/os_msg.h:37, from src/tr143_common.h:29, from src/tr143_load.h:20, from src/tr143_load.c:15: /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:467:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_BRIDGE_MAX_INST=11&#39; 467 | #pragma message(PRINT_MAX_INST(DEV2_BRIDGE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:521:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_RADIO_MAX_INST=3&#39; 521 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_RADIO_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:530:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> WIFI_RADIO_STATS_MAX_INST=3&#39; 530 | #pragma message(PRINT_MAX_INST(WIFI_RADIO_STATS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:539:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DIAGNOSTICRESULT_MAX_INST=192&#39; 539 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DIAGNOSTICRESULT_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:557:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_SSID_MAX_INST=24&#39; 557 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_SSID_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:566:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> WIFI_SSID_STATS_MAX_INST=24&#39; 566 | #pragma message(PRINT_MAX_INST(WIFI_SSID_STATS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:575:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_AP_MAX_INST=24&#39; 575 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_AP_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:584:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_SECURITY_MAX_INST=24&#39; 584 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_SECURITY_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:593:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_WPS_MAX_INST=24&#39; 593 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_WPS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:602:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_ASSOC_DEV_MAX_INST=384&#39; 602 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_ASSOC_DEV_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:611:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_ASSOC_DEV_STAT_MAX_INST=384&#39; 611 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_ASSOC_DEV_STAT_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:620:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_AC_MAX_INST=96&#39; 620 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_AC_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:629:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_SCHEDULE_MAX_INST=24&#39; 629 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_SCHEDULE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:638:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_ACL_MAX_INST=24&#39; 638 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_ACL_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:647:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_MACTABLE_MAX_INST=128&#39; 647 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_MACTABLE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:656:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_CONTROLFUNCTION_MAX_INST=24&#39; 656 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_CONTROLFUNCTION_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:665:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_X_PCCWCPE_CONTROL_MAX_INST=24&#39; 665 | #pragma message(PRINT_MAX_INST(DEV2_X_PCCWCPE_CONTROL_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:674:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_WDSBRIDGE_MAX_INST=3&#39; 674 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_WDSBRIDGE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:683:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_ENDPOINT_WPS_MAX_INST=3&#39; 683 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_ENDPOINT_WPS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:692:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_MAX_INST=16&#39; 692 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:701:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_RADIO_MAX_INST=48&#39; 701 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_RADIO_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:710:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_AP_MAX_INST=480&#39; 710 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_AP_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:719:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_ASSOCDEV_MAX_INST=1024&#39; 719 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_ASSOCDEV_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:728:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_STATS_MAX_INST=1024&#39; 728 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_STATS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:737:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_STESTATS_MAX_INST=1024&#39; 737 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_STESTATS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:746:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_STEHISTORY_MAX_INST=384&#39; 746 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_STEHISTORY_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:764:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_ETHERNET_MAX_INST=16&#39; 764 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_ETHERNET_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:773:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_ETHASSOCDEV_MAX_INST=192&#39; 773 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_ETHASSOCDEV_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:782:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_MEMSTATUS_MAX_INST=16&#39; 782 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_MEMSTATUS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:791:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_QOE_MAX_INST=16&#39; 791 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_QOE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:800:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_INTERFACE_MAX_INST=256&#39; 800 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_INTERFACE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:809:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_COMPONENT_MAX_INST=1024&#39; 809 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_COMPONENT_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:818:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_APDEV_WPS_MAX_INST=16&#39; 818 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_APDEV_WPS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:845:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_TS_POLICY_MAX_INST=12&#39; 845 | #pragma message(PRINT_MAX_INST(DEV2_TS_POLICY_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:854:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_TS_ETH_POLICY_MAX_INST=8&#39; 854 | #pragma message(PRINT_MAX_INST(DEV2_TS_ETH_POLICY_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:926:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_DEV_MAX_INST=16&#39; 926 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_DEV_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:935:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_RADIO_MAX_INST=48&#39; 935 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_RADIO_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:953:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_CUROPCLASSPROF_MAX_INST=192&#39; 953 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_CUROPCLASSPROF_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:962:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_BSS_MAX_INST=480&#39; 962 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_BSS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:971:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_STA_MAX_INST=1024&#39; 971 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_STA_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:998:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_STA_X_TP_QOE_MAX_INST=1024&#39; 998 | #pragma message(PRINT_MAX_INST(DEV2_STA_X_TP_QOE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1007:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_STA_X_TP_QOE_FACTOR_MAX_INST=1024&#39; 1007 | #pragma message(PRINT_MAX_INST(DEV2_STA_X_TP_QOE_FACTOR_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1016:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_BACKHAUL_STA_MAX_INST=48&#39; 1016 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_BACKHAUL_STA_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1025:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_CAP_MAX_INST=48&#39; 1025 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_CAP_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1034:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_CAP_PROF_MAX_INST=800&#39; 1034 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_CAP_PROF_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1088:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_SCAN_RESULT_MAX_INST=1024&#39; 1088 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_SCAN_RESULT_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1097:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_OPCLASS_SCAN_MAX_INST=4096&#39; 1097 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_OPCLASS_SCAN_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1106:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_CHANNEL_SCAN_MAX_INST=4096&#39; 1106 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_CHANNEL_SCAN_MAX_INST)) | ^~~~~~~ In file included from /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/os_msg.h:37, from src/tr143_common.h:29, from src/tr143_load.h:20, from src/tr143_load.c:15: /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1115:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_NEIGHBORBSS_MAX_INST=4096&#39; 1115 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_NEIGHBORBSS_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1124:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_UNASSOCSTA_MAX_INST=1024&#39; 1124 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_UNASSOCSTA_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1133:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_DEVICE_X_TP_QOE_MAX_INST=16&#39; 1133 | #pragma message(PRINT_MAX_INST(DEV2_DEVICE_X_TP_QOE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1142:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_DEVICE_X_TP_QOE_FACTOR_MAX_INST=16&#39; 1142 | #pragma message(PRINT_MAX_INST(DEV2_DEVICE_X_TP_QOE_FACTOR_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1205:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_ASSOC_DATA_MAX_INST=128&#39; 1205 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_ASSOC_DATA_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:1214:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_WIFI_DE_DISASSOC_DATA_MAX_INST=128&#39; 1214 | #pragma message(PRINT_MAX_INST(DEV2_WIFI_DE_DISASSOC_DATA_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:3392:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_MULTIMODE_AP_MAX_INST=3&#39; 3392 | #pragma message(PRINT_MAX_INST(DEV2_MULTIMODE_AP_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:3401:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_MULTIMODE_RE_MAX_INST=3&#39; 3401 | #pragma message(PRINT_MAX_INST(DEV2_MULTIMODE_RE_MAX_INST)) | ^~~~~~~ /home/bba/work/NB450/bba_3_0_platform/platform/apps/public/os_libs/include/dm_instanceMaxNum.h:3410:11: note: &#39;#pragma message: <-- DM_MACRO_Redefined --> DEV2_MULTIMODE_ROUTER_MAX_INST=3&#39; 3410 | #pragma message(PRINT_MAX_INST(DEV2_MULTIMODE_ROUTER_MAX_INST)) | ^~~~~~~ src/tr143_load.c: In function &#39;getIntfNameAndDns&#39;: src/tr143_load.c:2566:117: error: expected &#39;)&#39; before &#39;{&#39; token 2566 | IPCP_PATH, OID_DEV2_PPP_INTF_IPCP, sizeof(DEV2_PPP_INTF_IPCP_OBJ), &ipcpstack, &ipcpObj)) != CMM_OK) | ^ | ) 2567 | { | ~ src/tr143_load.c:2565:16: note: to match this &#39;(&#39; 2565 | if ((ret = RDP_WRAP(CMM_UI_INTERNAL, OID_DEV2, rsl_util_getObjFromFullpath( | ^ src/tr143_load.c:2574:9: error: expected expression before &#39;}&#39; token 2574 | } | ^ In file included from /home/bba/work/NB450/bba_3_0_platform/platform/apps/private/user/clibs//cmm_lib/include/rdp.h:21, from src/tr143_common.h:33, from src/tr143_load.h:20, from src/tr143_load.c:15: /home/bba/work/NB450/bba_3_0_platform/platform/apps/private/user/clibs//cmm_lib/include/dm_objId.h:1807:33: error: passing argument 2 of &#39;rdp_getSpecifiedObj&#39; makes pointer from integer without a cast [-Werror=int-conversion] 1807 | #define OID_DEV2_DHCPV6_CLIENT (353) | ^~~~~ | | | int src/tr143_load.c:2585:60: note: in expansion of macro &#39;OID_DEV2_DHCPV6_CLIENT&#39; 2585 | if (CMM_OK == rdp_getSpecifiedObj(CMM_UI_NULL, OID_DEV2_DHCPV6_CLIENT, | ^~~~~~~~~~~~~~~~~~~~~~ In file included from src/tr143_common.h:33, from src/tr143_load.h:20, from src/tr143_load.c:15: /home/bba/work/NB450/bba_3_0_platform/platform/apps/private/user/clibs//cmm_lib/include/rdp.h:1922:56: note: expected &#39;const char *&#39; but argument is of type &#39;int&#39; 1922 | CMM_RET rdp_getSpecifiedObj(CMM_UIID uiId, const char *pOidStr, | ~~~~~~~~~~~~^~~~~~~ src/tr143_load.c: In function &#39;loadParseIntfAndURL&#39;: src/tr143_load.c:2686:34: error: passing argument 1 of &#39;tr143_getDefaultIntfName&#39; from incompatible pointer type [-Werror=incompatible-pointer-types] 2686 | tr143_getDefaultIntfName(pIntf, intfLen); | ^~~~~ | | | char * src/tr143_load.c:2353:57: note: expected &#39;LOAD_MULTI_CFG *&#39; {aka &#39;struct _LOAD_MULTI_CFG *&#39;} but argument is of type &#39;char *&#39; 2353 | static CMM_RET tr143_getDefaultIntfName(LOAD_MULTI_CFG *pCfg, char *pIntf, size_t intfLen) | ~~~~~~~~~~~~~~~~^~~~ src/tr143_load.c:2686:41: error: passing argument 2 of &#39;tr143_getDefaultIntfName&#39; makes pointer from integer without a cast [-Werror=int-conversion] 2686 | tr143_getDefaultIntfName(pIntf, intfLen); | ^~~~~~~ | | | size_t {aka long unsigned int} src/tr143_load.c:2353:69: note: expected &#39;char *&#39; but argument is of type &#39;size_t&#39; {aka &#39;long unsigned int&#39;} 2353 | MM_RET tr143_getDefaultIntfName(LOAD_MULTI_CFG *pCfg, char *pIntf, size_t intfLen) | ~~~~~~^~~~~ src/tr143_load.c:2686:9: error: too few arguments to function &#39;tr143_getDefaultIntfName&#39; 2686 | tr143_getDefaultIntfName(pIntf, intfLen); | ^~~~~~~~~~~~~~~~~~~~~~~~ src/tr143_load.c:2353:16: note: declared here 2353 | static CMM_RET tr143_getDefaultIntfName(LOAD_MULTI_CFG *pCfg, char *pIntf, size_t intfLen) | ^~~~~~~~~~~~~~~~~~~~~~~~ src/tr143_load.c:2704:41: error: passing argument 1 of &#39;getIntfNameAndDns&#39; from incompatible pointer type [-Werror=incompatible-pointer-types] 2704 | if (CMM_OK != getIntfNameAndDns(tmpinterface, sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~~~~~~~~~~ | | | char * src/tr143_load.c:2501:50: note: expected &#39;LOAD_MULTI_CFG *&#39; {aka &#39;struct _LOAD_MULTI_CFG *&#39;} but argument is of type &#39;char *&#39; 2501 | static CMM_RET getIntfNameAndDns(LOAD_MULTI_CFG *pCfg, char interface[], size_t interfaceSize, | ~~~~~~~~~~~~~~~~^~~~ src/tr143_load.c:2704:55: error: passing argument 2 of &#39;getIntfNameAndDns&#39; makes pointer from integer without a cast [-Werror=int-conversion] 2704 | if (CMM_OK != getIntfNameAndDns(tmpinterface, sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~~~~~~~~~~~~~~~~~~ | | | long unsigned int src/tr143_load.c:2501:61: note: expected &#39;char *&#39; but argument is of type &#39;long unsigned int&#39; 2501 | static CMM_RET getIntfNameAndDns(LOAD_MULTI_CFG *pCfg, char interface[], size_t interfaceSize, | ~~~~~^~~~~~~~~~~ src/tr143_load.c:2704:81: error: passing argument 3 of &#39;getIntfNameAndDns&#39; makes integer from pointer without a cast [-Werror=int-conversion] 2704 | = getIntfNameAndDns(tmpinterface, sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ~~~~^~~~~~~~ | | | char * src/tr143_load.c:2501:81: note: expected &#39;size_t&#39; {aka &#39;long unsigned int&#39;} but argument is of type &#39;char *&#39; 2501 | tfNameAndDns(LOAD_MULTI_CFG *pCfg, char interface[], size_t interfaceSize, | ~~~~~~~^~~~~~~~~~~~~ src/tr143_load.c:2704:91: error: passing argument 4 of &#39;getIntfNameAndDns&#39; makes pointer from integer without a cast [-Werror=int-conversion] 2704 | ameAndDns(tmpinterface, sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~~~~~~~~~~~~~~~~~~ | | | long unsigned int src/tr143_load.c:2502:39: note: expected &#39;char *&#39; but argument is of type &#39;long unsigned int&#39; 2502 | char intfName[], size_t intfNameSize, char dns[], size_t dnsSize) | ~~~~~^~~~~~~~~~ src/tr143_load.c:2704:113: error: passing argument 5 of &#39;getIntfNameAndDns&#39; makes integer from pointer without a cast [-Werror=int-conversion] 2704 | , sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~ | | | char * src/tr143_load.c:2502:58: note: expected &#39;size_t&#39; {aka &#39;long unsigned int&#39;} but argument is of type &#39;char *&#39; 2502 | char intfName[], size_t intfNameSize, char dns[], size_t dnsSize) | ~~~~~~~^~~~~~~~~~~~ src/tr143_load.c:2704:118: error: passing argument 6 of &#39;getIntfNameAndDns&#39; makes pointer from integer without a cast [-Werror=int-conversion] 2704 | eof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~~~~~~~~~ | | | long unsigned int src/tr143_load.c:2502:77: note: expected &#39;char *&#39; but argument is of type &#39;long unsigned int&#39; 2502 | char intfName[], size_t intfNameSize, char dns[], size_t dnsSize) | ~~~~~^~~~~ src/tr143_load.c:2704:23: error: too few arguments to function &#39;getIntfNameAndDns&#39; 2704 | if (CMM_OK != getIntfNameAndDns(tmpinterface, sizeof(tmpinterface), pCfg->ifName, sizeof(pCfg->ifName), dns, sizeof(dns))) | ^~~~~~~~~~~~~~~~~ src/tr143_load.c:2501:16: note: declared here 2501 | static CMM_RET getIntfNameAndDns(LOAD_MULTI_CFG *pCfg, char interface[], size_t interfaceSize, | ^~~~~~~~~~~~~~~~~ src/tr143_load.c:2850:34: error: passing argument 4 of &#39;tr143_initSockAddrV6&#39; from incompatible pointer type [-Werror=incompatible-pointer-types] 2850 | &(pCfg->dstAddr), | ^~~~~~~~~~~~~~~~ | | | struct sockaddr_in * In file included from src/tr143_load.h:19, from src/tr143_load.c:15: src/tr143_socketWrapper.h:240:80: note: expected &#39;TR143_ADDR_V6 *&#39; {aka &#39;struct sockaddr_in6 *&#39;} but argument is of type &#39;struct sockaddr_in *&#39; 240 | TR143_ADDR_V6 *pV6Addr, | ~~~~~~~~~~~~~~~^~~~~~~ src/tr143_load.c: In function &#39;loadInitCFG&#39;: src/tr143_load.c:2954:41: error: assignment to expression with array type 2954 | pCfg->ipVersion = download_diag_obj->protocolVersion; | ^ src/tr143_load.c:3016:41: error: assignment to expression with array type 3016 | pCfg->ipVersion = download_diag_obj->protocolVersion; | ^ In file included from <command-line>: src/tr143_load.c: In function &#39;loadDiag_multi&#39;: src/tr143_load.c:3558:21: warning: format &#39;%d&#39; expects a matching &#39;int&#39; argument [-Wformat=] 3558 | TR143_DEBUG("doru(%c) instance(%d) g_loadNum(%d) max(%d) start", pCfg->doru, g_loadNum, MAX_TR143_LOAD_NUM); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/tr143_print.h:39:17: note: in definition of macro &#39;TR143_WRITE&#39; 39 | args) | ^~~~ src/tr143_load.c:3558:9: note: in expansion of macro &#39;TR143_DEBUG&#39; 3558 | TR143_DEBUG("doru(%c) instance(%d) g_loadNum(%d) max(%d) start", pCfg->doru, g_loadNum, MAX_TR143_LOAD_NUM); | ^~~~~~~~~~~ src/tr143_load.c:3558:63: note: format string is defined here 3558 | TR143_DEBUG("doru(%c) instance(%d) g_loadNum(%d) max(%d) start", pCfg->doru, g_loadNum, MAX_TR143_LOAD_NUM); | ~^ | | | int src/tr143_load.c: At top level: cc1: note: unrecognized command-line option &#39;-Wno-unknown-warning-option&#39; may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option &#39;-Wno-pragma-pack&#39; may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option &#39;-Wno-parentheses-equality&#39; may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option &#39;-Wno-incompatible-function-pointer-types&#39; may have been intended to silence earlier diagnostics cc1: all warnings being treated as errors Makefile:46: recipe for target &#39;tr143_load.o&#39; failed make[2]: *** [tr143_load.o] Error 1 make[2]: Leaving directory &#39;/home/bba/work/NB450/bba_3_0_platform/platform/apps/private/user/tr143&#39; Makefile:1087: recipe for target &#39;tr143&#39; failed make[1]: *** [tr143] Error 2 make[1]: Leaving directory &#39;/home/bba/work/NB450/bba_3_0_platform/platform/apps/private/user&#39; /home/bba/work/NB450/bba_3_0_platform/platform/build/makes/Makefile.apps.private:105: recipe for target &#39;cmm&#39; failed make: *** [cmm] Error 2 quectel@38284d820af1:/home/bba/work/NB450/bba_3_0_platform/platform/build$ 解析错在哪了 给我分析一下这个Bug
最新发布
10-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值