If you started your first patrol before 1 Sept 1939 (and with GWX you can start as early as Aug 1939), you aren't at war with anyone yet.
You won't be at war with Poland until 1 Sept, or with England until 3 Sept.
Before those dates
all countries are effectively neutral (because there is no war to takes sides in) and if you shoot at them you have, in essence, begun your own personal war with the world at large. You are a kaleun gone rogue! And any other neutral units you encounter (which means, basically, everybody) are liable to take potshots at you because of that.
Also you will lose renown for sinking any ship prior to 1 Sept as all ships are counted as neutral before that date.
FYI once the war does start, if you attack anything that is neutral or friendly (even by accident) all other units from that nation will still consider themselves to be at war with you - personally - for the following 24 hours of game time.